|
Cataclysm BN
|
#include <character.h>
Classes | |
| struct | comfort_response_t |
| struct | has_mission_item_filter |
| struct | trait_data |
Public Types | |
| enum class | comfort_level { impossible = -999 , uncomfortable = -7 , neutral = 0 , slightly_comfortable = 3 , comfortable = 5 , very_comfortable = 10 } |
| enum | water_tolerance { WT_IGNORED = 0 , WT_NEUTRAL , WT_GOOD , NUM_WATER_TOLERANCE } |
| using | trap_map = std::map< tripoint, std::string > |
Public Types inherited from Creature | |
| enum | Attitude : int { A_HOSTILE , A_NEUTRAL , A_FRIENDLY , A_ANY } |
| Simplified attitude towards any creature: hostile - hate, want to kill, etc. More... | |
Public Member Functions | |
| Character (const Character &)=delete | |
| Character & | operator= (const Character &)=delete |
| ~Character () override | |
| Character * | as_character () override |
| const Character * | as_character () const override |
| character_id | getID () const |
| void | setID (character_id i, bool force=false) |
| field_type_id | bloodType () const override |
| field_type_id | gibType () const override |
| bool | is_warm () const override |
| bool | in_species (const species_id &spec) const override |
| const std::string & | symbol () const override |
| virtual int | get_str () const |
| Getters for stats exclusive to characters. More... | |
| virtual int | get_dex () const |
| virtual int | get_per () const |
| virtual int | get_int () const |
| virtual int | get_str_base () const |
| virtual int | get_dex_base () const |
| virtual int | get_per_base () const |
| virtual int | get_int_base () const |
| virtual int | get_str_bonus () const |
| virtual int | get_dex_bonus () const |
| virtual int | get_per_bonus () const |
| virtual int | get_int_bonus () const |
| int | get_speed () const override |
| virtual int | ranged_dex_mod () const |
| virtual int | ranged_per_mod () const |
| virtual void | set_str_bonus (int nstr) |
| Setters for stats exclusive to characters. More... | |
| virtual void | set_dex_bonus (int ndex) |
| virtual void | set_per_bonus (int nper) |
| virtual void | set_int_bonus (int nint) |
| virtual void | mod_str_bonus (int nstr) |
| virtual void | mod_dex_bonus (int ndex) |
| virtual void | mod_per_bonus (int nper) |
| virtual void | mod_int_bonus (int nint) |
| void | print_health () const |
| virtual int | get_healthy () const |
| Getters for health values exclusive to characters. More... | |
| virtual int | get_healthy_mod () const |
| virtual void | mod_healthy (int nhealthy) |
| Modifiers for health values exclusive to characters. More... | |
| virtual void | mod_healthy_mod (int nhealthy_mod, int cap) |
| virtual void | set_healthy (int nhealthy) |
| Setters for health values exclusive to characters. More... | |
| virtual void | set_healthy_mod (int nhealthy_mod) |
| int | get_stored_kcal () const |
| Getter for need values exclusive to characters. More... | |
| int | max_stored_kcal () const |
| float | get_kcal_percent () const |
| int | get_thirst () const |
| std::pair< std::string, nc_color > | get_thirst_description () const |
| std::pair< std::string, nc_color > | get_hunger_description () const |
| std::pair< std::string, nc_color > | get_fatigue_description () const |
| int | get_fatigue () const |
| int | get_sleep_deprivation () const |
| std::pair< std::string, nc_color > | get_pain_description () const override |
| virtual void | mod_stored_kcal (int nkcal) |
| Modifiers for need values exclusive to characters. More... | |
| virtual void | mod_stored_nutr (int nnutr) |
| virtual void | mod_thirst (int nthirst) |
| virtual void | mod_fatigue (int nfatigue) |
| virtual void | mod_sleep_deprivation (int nsleep_deprivation) |
| virtual void | set_stored_kcal (int kcal) |
| Setters for need values exclusive to characters. More... | |
| virtual void | set_thirst (int nthirst) |
| virtual void | set_fatigue (int nfatigue) |
| virtual void | set_sleep_deprivation (int nsleep_deprivation) |
| void | mod_stat (const std::string &stat, float modifier) override |
| m_size | get_size () const override |
| Get size class of character. More... | |
| void | recalculate_size () |
| Recalculate size class of character. More... | |
| std::string | disp_name (bool possessive=false, bool capitalize_first=false) const override |
| Returns either "you" or the player's name. More... | |
| std::string | skin_name () const override |
| Returns the name of the player's outer layer, e.g. More... | |
| virtual faction * | get_faction () const |
| void | set_fac_id (const std::string &my_fac_id) |
| int | effective_dispersion (int dispersion) const |
| std::vector< aim_type > | get_aim_types (const item &gun) const |
| std::pair< int, int > | get_fastest_sight (const item &gun, double recoil) const |
| int | get_most_accurate_sight (const item &gun) const |
| double | aim_speed_skill_modifier (const skill_id &gun_skill) const |
| double | aim_speed_dex_modifier () const |
| double | aim_speed_encumbrance_modifier () const |
| double | aim_cap_from_volume (const item &gun) const |
| double | aim_per_move (const item &gun, double recoil) const |
| double | recoil_vehicle () const |
| Get maximum recoil penalty due to vehicle motion. More... | |
| double | recoil_mode () const |
| double | recoil_total () const |
| Current total maximum recoil penalty from all sources. More... | |
| float | get_dodge_base () const override |
| Combat getters. More... | |
| float | get_hit_base () const override |
| float | get_dodge () const override |
| const tripoint & | pos () const override |
| int | sight_range (int light_level) const override |
| Returns the player's sight range. More... | |
| int | unimpaired_range () const |
| Returns the player maximum vision range factoring in mutations, diseases, and other effects. More... | |
| bool | overmap_los (const tripoint_abs_omt &omt, int sight_points) |
| Returns true if overmap tile is within player line-of-sight. More... | |
| int | overmap_sight_range (int light_level) const |
| Returns the distance the player can see on the overmap. More... | |
| int | clairvoyance () const |
| Returns the distance the player can see through walls. More... | |
| bool | sight_impaired () const |
| Returns true if the player has some form of impaired sight. More... | |
| bool | has_alarm_clock () const |
| Returns true if the player or their vehicle has an alarm clock. More... | |
| bool | has_watch () const |
| Returns true if the player or their vehicle has a watch. More... | |
| void | action_taken () |
| Called after every action, invalidates player caches. More... | |
| bool | is_on_ground () const override |
| Returns true if the player is knocked over or has broken legs. More... | |
| int | swim_speed () const |
| Returns the player's speed for swimming across water tiles. More... | |
| void | add_miss_reason (const std::string &reason, unsigned int weight) |
| Adds a reason for why the player would miss a melee attack. More... | |
| void | clear_miss_reasons () |
| Clears the list of reasons for why the player would miss a melee attack. More... | |
| std::string | get_miss_reason () |
| Returns an explanation for why the player would miss a melee attack. More... | |
| void | regen (int rate_multiplier) |
| Handles passive regeneration of pain and maybe hp. More... | |
| void | enforce_minimum_healing () |
| item * | best_quality_item (const quality_id &qual) |
| get best quality item that this character has More... | |
| virtual void | update_health (int external_modifiers=0) |
| Handles health fluctuations over time. More... | |
| void | update_body () |
| Updates all "biology" by one turn. More... | |
| void | update_body (const time_point &from, const time_point &to) |
Updates all "biology" as if time between from and to passed. More... | |
| void | update_stomach (const time_point &from, const time_point &to) |
| Updates the stomach to give accurate hunger messages. More... | |
| void | update_needs (int rate_multiplier) |
| Increases hunger, thirst, fatigue and stimulants wearing off. More... | |
| needs_rates | calc_needs_rates () const |
| void | check_needs_extremes () |
| Kills the player if too hungry, stimmed up etc., forces tired player to sleep and prints warnings. More... | |
| bool | is_hibernating () const |
| Returns if the player has hibernation mutation and is asleep and well fed. More... | |
| void | update_bodytemp (const map &m, const weather_manager &weather) |
| Maintains body temperature. More... | |
| void | temp_equalizer (const bodypart_id &bp1, const bodypart_id &bp2) |
| Equalizes heat between body parts. More... | |
| comfort_response_t | base_comfort_value (const tripoint &p) const |
| Rate point's ability to serve as a bed. More... | |
| int | blood_loss (const bodypart_id &bp) const |
| Define blood loss (in percents) More... | |
| void | reset_bonuses () override |
| Resets the value of all bonus fields to 0. More... | |
| void | reset_stats () override |
| Resets stats, and applies effects in an idempotent manner. More... | |
| void | reset () override |
| Handles stat and bonus reset. More... | |
| void | reset_encumbrance () |
| Recalculates encumbrance cache. More... | |
| int | encumb (body_part bp) const |
| Returns ENC provided by armor, etc. More... | |
| units::mass | get_weight () const override |
| Returns body weight plus weight of inventory and worn/wielded items. More... | |
| char_encumbrance_data | get_encumbrance () const |
| Get encumbrance for all body parts. More... | |
| char_encumbrance_data | get_encumbrance (const item &new_item) const |
Get encumbrance for all body parts as if new_item was also worn. More... | |
| int | extraEncumbrance (layer_level level, int bp) const |
| Get encumbrance penalty per layer & body part. More... | |
| bool | is_wearing_power_armor (bool *hasHelmet=nullptr) const |
| Returns true if the character is wearing power armor. More... | |
| bool | is_wearing_active_power_armor () const |
| Returns true if the character is wearing active power. More... | |
| bool | is_wearing_active_optcloak () const |
| Returns true if the player is wearing an active optical cloak. More... | |
| bool | in_climate_control () |
| Returns true if the player is in a climate controlled area or armor. More... | |
| bool | is_blind () const |
| Returns true if the player isn't able to see. More... | |
| bool | is_invisible () const |
| int | visibility (bool check_color=false, int stillness=0) const |
| Checks is_invisible() as well as other factors. More... | |
| float | active_light () const |
| Returns character luminosity based on the brightest active item they are carrying. More... | |
| bool | sees_with_specials (const Creature &critter) const |
| body_part_set | exclusive_flag_coverage (const std::string &flag) const |
Bitset of all the body parts covered only with items with flag (or nothing) More... | |
| bool | move_effects (bool attacking) override |
| Processes effects which may prevent the Character from moving (bear traps, crushed, etc.). More... | |
| void | wait_effects () |
| bool | movement_mode_is (character_movemode mode) const |
| Check against the character's current movement mode. More... | |
| character_movemode | get_movement_mode () const |
| virtual void | set_movement_mode (character_movemode mode)=0 |
| void | expose_to_disease (diseasetype_id dis_type) |
| Determine if character is susceptible to dis_type and if so apply the symptoms. More... | |
| void | process_turn () override |
| Handles end-of-turn processing. More... | |
| void | recalc_hp () |
| Recalculates HP after a change to max strength. More... | |
| void | calc_all_parts_hp (float hp_mod=0.0, float hp_adjust=0.0, int str_max=0) |
| Sets hp for all body parts. More... | |
| void | recalc_sight_limits () |
| Modifies the player's sight values Must be called when any of the following change: This must be called when any of the following change: More... | |
| float | get_vision_threshold (float light_level) const |
| Returns the apparent light level at which the player can see. More... | |
| void | flag_encumbrance () |
| Flag encumbrance for updating. More... | |
| void | check_item_encumbrance_flag () |
| Checks worn items for the "RESET_ENCUMBRANCE" flag, which indicates that encumbrance may have changed and require recalculating. More... | |
| bool | natural_attack_restricted_on (const bodypart_id &bp) const |
| Returns true if the character is wearing something on the entered body_part, ignoring items with the ALLOWS_NATURAL_ATTACKS flag. More... | |
| bool | can_miss_recovery (const item &weap) const |
| Returns true if the player is able to use a miss recovery technique. More... | |
| bool | is_quiet () const |
| Returns true if the player has quiet melee attacks. More... | |
| bool | block_hit (Creature *source, bodypart_id &bp_hit, damage_instance &dam) override |
| Checks for valid block abilities and reduces damage accordingly. More... | |
| item & | best_shield () |
| Returns the best item for blocking with. More... | |
| bool | handle_melee_wear (item &shield, float wear_multiplier=1.0f) |
| Calculates melee weapon wear-and-tear through use, returns true if item is destroyed. More... | |
| matec_id | pick_technique (Creature &t, const item &weap, bool crit, bool dodge_counter, bool block_counter) |
| Returns a random valid technique. More... | |
| void | perform_technique (const ma_technique &technique, Creature &t, damage_instance &di, int &move_cost) |
| void | melee_attack (Creature &t, bool allow_special, const matec_id &force_technique, bool allow_unarmed=true) |
| Sets up a melee attack and handles melee attack function calls. More... | |
| void | melee_attack (Creature &t, bool allow_special) |
| Calls the to other melee_attack function with an empty technique id (meaning no specific technique should be used). More... | |
| std::string | melee_special_effects (Creature &t, damage_instance &d, item &weap) |
| Handles combat effects, returns a string of any valid combat effect messages. More... | |
| void | perform_special_attacks (Creature &t, dealt_damage_instance &dealt_dam) |
| Performs special attacks and their effects (poisonous, stinger, etc.) More... | |
| std::vector< special_attack > | mutation_attacks (Creature &t) const |
| Returns a vector of valid mutation attacks. More... | |
| float | bonus_damage (bool random) const |
| Returns the bonus bashing damage the player deals based on their stats. More... | |
| float | get_melee_hit_base () const |
| Returns weapon skill. More... | |
| float | hit_roll () const override |
| Returns the player's basic hit roll that is compared to the target's dodge roll. More... | |
| double | crit_chance (float roll_hit, float target_dodge, const item &weap) const |
| Returns the chance to critical given a hit roll and target's dodge roll. More... | |
| bool | scored_crit (float target_dodge, const item &weap) const |
| Returns true if the player scores a critical hit. More... | |
| int | attack_cost (const item &weap) const |
| Returns cost (in moves) of attacking with given item (no modifiers, like stuck) More... | |
| float | get_hit_weapon (const item &weap) const |
| Gets melee accuracy component from weapon+skills. More... | |
| void | roll_all_damage (bool crit, damage_instance &di, bool average, const item &weap) const |
| Adds all 3 types of physical damage to instance. More... | |
| void | roll_bash_damage (bool crit, damage_instance &di, bool average, const item &weap) const |
| Adds player's total bash damage to the damage instance. More... | |
| void | roll_cut_damage (bool crit, damage_instance &di, bool average, const item &weap) const |
| Adds player's total cut damage to the damage instance. More... | |
| void | roll_stab_damage (bool crit, damage_instance &di, bool average, const item &weap) const |
| Adds player's total stab damage to the damage instance. More... | |
| void | on_hit (Creature *source, bodypart_id, float, dealt_projectile_attack const *) override |
| This creature just got hit by an attack - possibly special/ranged attack - from source. More... | |
| void | did_hit (Creature &target) |
| void | apply_damage (Creature *source, bodypart_id hurt, int dam, bool bypass_med=false) override |
| Actually hurt the player, hurts a body_part directly, no armor reduction. More... | |
| dealt_damage_instance | deal_damage (Creature *source, bodypart_id bp, const damage_instance &d) override |
| Calls Creature::deal_damage and handles damaged effects (waking up, etc.) More... | |
| int | reduce_healing_effect (const efftype_id &eff_id, int remove_med, const bodypart_id &hurt) |
| Reduce healing effect intensity, return initial intensity of the effect. More... | |
| void | cough (bool harmful=false, int loudness=4) |
| void | passive_absorb_hit (const bodypart_id &bp, damage_unit &du) const |
| Check for relevant passive, non-clothing that can absorb damage, and reduce by specified damage unit. More... | |
| void | absorb_hit (const bodypart_id &bp, damage_instance &dam) override |
| Runs through all bionics and armor on a part and reduces damage through their armor_absorb. More... | |
| bool | armor_absorb (damage_unit &du, item &armor) |
| Reduces and mutates du, prints messages about armor taking damage. More... | |
| float | bionic_armor_bonus (const bodypart_id &bp, damage_type dt) const |
| Check for passive bionics that provide armor, and returns the armor bonus This is called from player::passive_absorb_hit. More... | |
| int | mabuff_armor_bonus (damage_type type) const |
| Returns the armor bonus against given type from martial arts buffs. More... | |
| std::map< bodypart_id, int > | get_armor_fire (const std::map< bodypart_id, std::vector< const item * > > &clothing_map) const |
| Returns overall fire resistance. More... | |
| bool | has_trait (const trait_id &b) const override |
| Returns true if the player has the entered trait. More... | |
| bool | has_base_trait (const trait_id &b) const |
| Returns true if the player has the entered starting trait. More... | |
| bool | has_trait_flag (const std::string &b) const |
| Returns true if player has a trait with a flag. More... | |
| bool | has_opposite_trait (const trait_id &flag) const |
| Returns true if character has a trait which cancels the entered trait. More... | |
| trait_id | trait_by_invlet (int ch) const |
| Returns the trait id with the given invlet, or an empty string if no trait has that invlet. More... | |
| void | toggle_trait (const trait_id &) |
| Toggles a trait on the player and in their mutation list. More... | |
| void | set_mutation (const trait_id &) |
| Add or removes a mutation on the player, but does not trigger mutation loss/gain effects. More... | |
| void | unset_mutation (const trait_id &) |
| void | switch_mutations (const trait_id &switched, const trait_id &target, bool start_powered) |
| Unset switched mutation and set target mutation instead. More... | |
| void | activate_mutation (const trait_id &mutation) |
| void | deactivate_mutation (const trait_id &mut) |
| void | mutation_spend_resources (const trait_id &mut) |
| Removes the appropriate costs (NOTE: will reapply mods & recalc sightlines in case of newly activated mutation). More... | |
| bool | can_mount (const monster &critter) const |
| void | mount_creature (monster &z) |
| bool | is_mounted () const |
| bool | check_mount_will_move (const tripoint &dest_loc) |
| bool | check_mount_is_spooked () |
| void | dismount () |
| void | forced_dismount () |
| bool | is_deaf () const |
| bool | has_two_arms () const |
| Returns true if the player has two functioning arms. More... | |
| int | get_working_arm_count () const |
| Returns the number of functioning arms. More... | |
| int | get_working_leg_count () const |
| Returns the number of functioning legs. More... | |
| bool | is_limb_disabled (const bodypart_id &limb) const |
| Returns true if the limb is disabled(12.5% or less hp) More... | |
| bool | is_limb_hindered (hp_part limb) const |
| Returns true if the limb is hindered(40% or less hp) More... | |
| bool | is_limb_broken (const bodypart_id &limb) const |
| Returns true if the limb is broken. More... | |
| bool | can_run () |
| source of truth of whether a Character can run More... | |
| void | hurtall (int dam, Creature *source, bool disturb=true) |
| Hurts all body parts for dam, no armor reduction. More... | |
| int | hitall (int dam, int vary, Creature *source) |
| Harms all body parts for dam, with armor reduction. More... | |
| void | on_hurt (Creature *source, bool disturb=true) |
| Handles effects that happen when the player is damaged and aware of the fact. More... | |
| void | heal (const bodypart_id &healed, int dam) |
| Heals a body_part for dam. More... | |
| void | healall (int dam) |
| Heals all body parts for dam. More... | |
| hp_part | body_window (const std::string &menu_header, bool show_all, bool precise, int normal_bonus, int head_bonus, int torso_bonus, float bleed, float bite, float infect, float bandage_power, float disinfectant_power) const |
| Displays menu with body part hp, optionally with hp estimation after healing. More... | |
| nc_color | limb_color (const bodypart_id &bp, bool bleed, bool bite, bool infect) const |
| bool | made_of (const material_id &m) const override |
| bool | made_of_any (const std::set< material_id > &ms) const override |
| int | posx () const override |
| int | posy () const override |
| int | posz () const override |
| void | setx (int x) |
| void | sety (int y) |
| void | setz (int z) |
| void | setpos (const tripoint &p) override |
| virtual tripoint | global_square_location () const |
| Global position, expressed in map square coordinate system (the most detailed coordinate system), used by the map. More... | |
| tripoint | global_sm_location () const |
| Returns the location of the player in global submap coordinates. More... | |
| tripoint_abs_omt | global_omt_location () const |
| Returns the location of the player in global overmap terrain coordinates. More... | |
| void | recalculate_enchantment_cache () |
| void | rebuild_mutation_cache () |
| double | bonus_from_enchantments (double base, enchant_vals::mod value, bool round=false) const |
| Calculate bonus from enchantments for given base value. More... | |
| bool | has_mabuff (const mabuff_id &buff_id) const |
| Returns true if the player has any martial arts buffs attached. More... | |
| bool | has_grab_break_tec () const override |
| Returns true if the player has a grab breaking technique available. More... | |
| float | mabuff_tohit_bonus () const |
| Returns the to hit bonus from martial arts buffs. More... | |
| float | mabuff_dodge_bonus () const |
| Returns the dodge bonus from martial arts buffs. More... | |
| int | mabuff_block_bonus () const |
| Returns the block bonus from martial arts buffs. More... | |
| int | mabuff_speed_bonus () const |
| Returns the speed bonus from martial arts buffs. More... | |
| int | mabuff_arpen_bonus (damage_type type) const |
| Returns the arpen bonus from martial arts buffs. More... | |
| float | mabuff_damage_mult (damage_type type) const |
| Returns the damage multiplier to given type from martial arts buffs. More... | |
| int | mabuff_damage_bonus (damage_type type) const |
| Returns the flat damage bonus to given type from martial arts buffs, applied after the multiplier. More... | |
| int | mabuff_attack_cost_penalty () const |
| Returns the flat penalty to move cost of attacks. More... | |
| float | mabuff_attack_cost_mult () const |
| Returns the multiplier on move cost of attacks. More... | |
| void | mutation_effect (const trait_id &mut) |
| Handles things like removal of armor, etc. More... | |
| void | mutation_loss_effect (const trait_id &mut) |
| Handles what happens when you lose a mutation. More... | |
| bool | has_active_mutation (const trait_id &b) const |
| void | mutate () |
| Picks a random valid mutation and gives it to the Character, possibly removing/changing others along the way. More... | |
| bool | mutation_ok (const trait_id &mutation, bool force_good, bool force_bad) const |
| Returns true if the player doesn't have the mutation or a conflicting one and it complies with the force typing. More... | |
| void | mutate_category (const std::string &mut_cat) |
| Picks a random valid mutation in a category and mutate_towards() it. More... | |
| bool | mutate_towards (std::vector< trait_id > muts, int num_tries=INT_MAX) |
| Mutates toward one of the given mutations, upgrading or removing conflicts if necessary. More... | |
| bool | mutate_towards (const trait_id &mut) |
| Mutates toward the entered mutation, upgrading or removing conflicts if necessary. More... | |
| void | remove_mutation (const trait_id &mut, bool silent=false) |
| Removes a mutation, downgrading to the previous level if possible. More... | |
| std::map< trait_id, float > | mutation_chances () const |
| Calculate percentage chances for mutations. More... | |
| bool | has_child_flag (const trait_id &flag) const |
| Returns true if the player has the entered mutation child flag. More... | |
| void | remove_child_flag (const trait_id &flag) |
| Removes the mutation's child flag from the player's list. More... | |
| void | set_highest_cat_level () |
| Recalculates mutation_category_level[] values for the player. More... | |
| std::string | get_highest_category () const |
| Returns the highest mutation category. More... | |
| void | drench_mut_calc () |
| Recalculates mutation drench protection for all bodyparts (ignored/good/neutral stats) More... | |
| void | build_mut_dependency_map (const trait_id &mut, std::unordered_map< trait_id, int > &dependency_map, int distance) |
| Recursively traverses the mutation's prerequisites and replacements, building up a map. More... | |
| bool | is_category_allowed (const std::vector< std::string > &category) const |
| Returns true if this category of mutation is allowed. More... | |
| bool | is_category_allowed (const std::string &category) const |
| bool | is_weak_to_water () const |
| bool | can_use_heal_item (const item &med) const |
| Check for mutation disallowing the use of an healing item. More... | |
| bool | can_install_cbm_on_bp (const std::vector< bodypart_id > &bps) const |
| resistances | mutation_armor (bodypart_id bp) const |
| Returns resistances on a body part provided by mutations. More... | |
| float | mutation_armor (bodypart_id bp, damage_type dt) const |
| float | mutation_armor (bodypart_id bp, const damage_unit &du) const |
| bool | activate_bionic (int b, bool eff_only=false) |
| Handles bionic activation effects of the entered bionic, returns if anything activated. More... | |
| std::vector< bionic_id > | get_bionics () const |
| std::pair< int, int > | amount_of_storage_bionics () const |
| Returns amount of Storage CBMs in the corpse. More... | |
| bool | has_bionic (const bionic_id &b) const |
| Returns true if the player has the entered bionic id. More... | |
| bool | has_active_bionic (const bionic_id &b) const |
| Returns true if the player has the entered bionic id and it is powered on. More... | |
| bool | has_any_bionic () const |
| Returns true if the player has any bionic. More... | |
| bool | can_fuel_bionic_with (const item &it) const |
| Returns true if the character can fuel a bionic with the item. More... | |
| std::vector< bionic_id > | get_bionic_fueled_with (const item &it) const |
| Return bionic_id of bionics able to use it as fuel. More... | |
| std::vector< bionic_id > | get_fueled_bionics () const |
| Return bionic_id of fueled bionics. More... | |
| bionic_id | get_remote_fueled_bionic () const |
| Returns bionic_id of first remote fueled bionic found. More... | |
| bionic_id | get_most_efficient_bionic (const std::vector< bionic_id > &bids) const |
| Return bionic_id of bionic of most fuel efficient bionic. More... | |
| std::vector< itype_id > | get_fuel_available (const bionic_id &bio) const |
| Return list of available fuel for this bionic. More... | |
| int | get_fuel_capacity (const itype_id &fuel) const |
| Return available space to store specified fuel. More... | |
| int | get_total_fuel_capacity (const itype_id &fuel) const |
| Return total space to store specified fuel. More... | |
| void | update_fuel_storage (const itype_id &fuel) |
| Updates which bionic contain fuel and which is empty. More... | |
| int | get_mod_stat_from_bionic (const character_stat &Stat) const |
| Get stat bonus from bionic. More... | |
| void | process_bionic (int b) |
| Handles bionic effects over time of the entered bionic. More... | |
| bool | deactivate_bionic (int b, bool eff_only=false) |
| Handles bionic deactivation effects of the entered bionic, returns if anything deactivated. More... | |
| int | num_bionics () const |
| Returns the size of my_bionics[]. More... | |
| bionic & | bionic_at_index (int i) |
| Returns the bionic at a given index in my_bionics[]. More... | |
| void | clear_bionics () |
| Remove all bionics. More... | |
| int | get_used_bionics_slots (const bodypart_id &bp) const |
| int | get_total_bionics_slots (const bodypart_id &bp) const |
| int | get_free_bionics_slots (const bodypart_id &bp) const |
| bool | has_enough_anesth (const itype *cbm, player &patient) |
| Has enough anesthetic for surgery. More... | |
| void | introduce_into_anesthesia (const time_duration &duration, player &installer, bool needs_anesthesia) |
| Handles process of introducing patient into anesthesia during Autodoc operations. More... | |
| void | remove_bionic (const bionic_id &b) |
| Removes a bionic from my_bionics[]. More... | |
| void | add_bionic (const bionic_id &b) |
| Adds a bionic to my_bionics[]. More... | |
| float | env_surgery_bonus (int radius) |
| Calculate skill bonus from tiles in radius. More... | |
| float | bionics_adjusted_skill (const skill_id &most_important_skill, const skill_id &important_skill, const skill_id &least_important_skill, int skill_level=-1) |
| Calculate skill for (un)installing bionics. More... | |
| int | bionics_pl_skill (const skill_id &most_important_skill, const skill_id &important_skill, const skill_id &least_important_skill, int skill_level=-1) |
| Calculate non adjusted skill for (un)installing bionics. More... | |
| bool | can_install_bionics (const itype &type, player &installer, bool autodoc=false, int skill_level=-1) |
| Is the installation possible. More... | |
| std::map< bodypart_id, int > | bionic_installation_issues (const bionic_id &bioid) const |
| bool | install_bionics (const itype &type, player &installer, bool autodoc=false, int skill_level=-1) |
| Initialize all the values needed to start the operation player_activity. More... | |
| void | perform_install (bionic_id bid, bionic_id upbid, int difficulty, int success, int pl_skill, const std::string &installer_name, const std::vector< trait_id > &trait_to_rem) |
| Success or failure of installation happens here. More... | |
| void | do_damage_for_bionic_failure (int min_damage, int max_damage) |
| void | bionics_install_failure (const std::string &installer, int difficulty, int success, float adjusted_skill) |
| bool | can_uninstall_bionic (const bionic_id &b_id, player &installer, bool autodoc=false, int skill_level=-1) |
| Is The uninstallation possible. More... | |
| bool | uninstall_bionic (const bionic_id &b_id, player &installer, bool autodoc=false, int skill_level=-1) |
| Initialize all the values needed to start the operation player_activity. More... | |
| void | perform_uninstall (bionic_id bid, int difficulty, int success, const units::energy &power_lvl, int pl_skill) |
| Succes or failure of removal happens here. More... | |
| void | bionics_uninstall_failure (int difficulty, int success, float adjusted_skill) |
| When a player fails the surgery. More... | |
| bool | uninstall_bionic (const bionic &target_cbm, monster &installer, player &patient, float adjusted_skill) |
| Used by monster to perform surgery. More... | |
| void | bionics_uninstall_failure (monster &installer, player &patient, int difficulty, int success, float adjusted_skill) |
| When a monster fails the surgery. More... | |
| bool | burn_fuel (int b, bool start=false) |
| Convert fuel to bionic power. More... | |
| void | passive_power_gen (int b) |
| Passively produce power from PERPETUAL fuel. More... | |
| itype_id | find_remote_fuel (bool look_only=false) |
| Find fuel used by remote powered bionic. More... | |
| int | consume_remote_fuel (int amount) |
| Consume fuel used by remote powered bionic, return amount of request unfulfilled (0 if totally successful). More... | |
| void | reset_remote_fuel () |
| void | heat_emission (int b, int fuel_energy) |
| Handle heat from exothermic power generation. More... | |
| float | get_effective_efficiency (int b, float fuel_efficiency) |
| Applies modifier to fuel_efficiency and returns the resulting efficiency. More... | |
| units::energy | get_power_level () const |
| units::energy | get_max_power_level () const |
| void | mod_power_level (const units::energy &npower) |
| void | mod_max_power_level (const units::energy &npower_max) |
| void | set_power_level (const units::energy &npower) |
| void | set_max_power_level (const units::energy &npower_max) |
| bool | is_max_power () const |
| bool | has_power () const |
| bool | has_max_power () const |
| bool | enough_power_for (const bionic_id &bid) const |
| void | conduct_blood_analysis () const |
| bool | is_worn (const item &thing) const |
| virtual bool | invoke_item (item *, const tripoint &pt) |
| Asks how to use the item (if it has more than one use_method) and uses it. More... | |
| virtual bool | invoke_item (item *, const std::string &, const tripoint &pt) |
| As above, but with a pre-selected method. More... | |
| virtual bool | invoke_item (item *) |
| As above two, but with position equal to current position. More... | |
| virtual bool | invoke_item (item *, const std::string &) |
| virtual bool | dispose_item (item_location &&obj, const std::string &prompt=std::string()) |
| Drop, wear, stash or otherwise try to dispose of an item consuming appropriate moves. More... | |
| bool | has_enough_charges (const item &it, bool show_msg) const |
| Has the item enough charges to invoke its use function? Also checks if UPS from this player is used instead of item charges. More... | |
| bool | consume_charges (item &used, int qty) |
| Consume charges of a tool or comestible item, potentially destroying it in the process. More... | |
| int | item_handling_cost (const item &it, bool penalties=true, int base_cost=INVENTORY_HANDLING_PENALTY) const |
| Calculate (but do not deduct) the number of moves required when handling (e.g. More... | |
| int | item_store_cost (const item &it, const item &container, bool penalties=true, int base_cost=INVENTORY_HANDLING_PENALTY) const |
| Calculate (but do not deduct) the number of moves required when storing an item in a container. More... | |
| int | item_wear_cost (const item &it) const |
| Calculate (but do not deduct) the number of moves required to wear an item. More... | |
| cata::optional< std::list< item >::iterator > | wear_item (const item &to_wear, bool interactive=true) |
| Wear item; returns nullopt on fail, or pointer to newly worn item on success. More... | |
| int | amount_worn (const itype_id &id) const |
| Returns the amount of item ‘type’ that is currently worn. More... | |
| std::vector< item_location > | nearby (const std::function< bool(const item *, const item *)> &func, int radius=1) const |
| Returns nearby items which match the provided predicate. More... | |
| std::list< item > | remove_worn_items_with (std::function< bool(item &)> filter) |
| Similar to remove_items_with, but considers only worn items and not their content (item::contents is not checked). More... | |
| item * | invlet_to_item (int invlet) |
| Return the item pointer of the item with given invlet, return nullptr if the player does not have such an item with that invlet. More... | |
| item & | i_at (int position) |
| const item & | i_at (int position) const |
| int | get_item_position (const item *it) const |
| Returns the item position (suitable for i_at or similar) of a specific item. More... | |
| const item & | used_weapon () const |
| Returns a reference to the item which will be used to make attacks. More... | |
| item & | used_weapon () |
| int | i_add_to_container (const item &it, bool unloading) |
| Try to find a container/s on character containing ammo of type it.typeId() and add charges until the container is full. More... | |
| item & | i_add (item it, bool should_stack=true) |
| item | i_rem (int pos) |
| Remove a specific item from player possession. More... | |
| item | i_rem (const item *it) |
| Remove a specific item from player possession. More... | |
| void | i_rem_keep_contents (int idx) |
| bool | i_add_or_drop (item &it, int qty=1) |
| Sets invlet and adds to inventory if possible, drops otherwise, returns true if either succeeded. More... | |
| std::bitset< std::numeric_limits< char >::max()> | allocated_invlets () const |
| Only use for UI things. More... | |
| bool | has_active_item (const itype_id &id) const |
| Whether the player carries an active item of the given item type. More... | |
| item | remove_weapon () |
| void | remove_mission_items (int mission_id) |
| std::vector< const item * > | get_ammo (const ammotype &at) const |
| Returns the items that are ammo and have the matching ammo type. More... | |
| std::vector< item_location > | find_ammo (const item &obj, bool empty=true, int radius=1) const |
| Searches for ammo or magazines that can be used to reload obj. More... | |
| std::vector< item_location > | find_reloadables () |
| Searches for weapons and magazines that can be reloaded. More... | |
| int | ammo_count_for (const item &gun) |
| Counts ammo and UPS charges (lower of) for a given gun on the character. More... | |
| int | throw_range (const item &) const |
| Maximum thrown range with a given item, taking all active effects into account. More... | |
| bool | unarmed_attack () const |
| True if unarmed or wielding a weapon with the UNARMED_WEAPON flag. More... | |
| int | best_nearby_lifting_assist () const |
| Checks for items, tools, and vehicles with the Lifting quality near the character returning the highest quality in range. More... | |
| int | best_nearby_lifting_assist (const tripoint &world_pos) const |
| Alternate version if you need to specify a different orign point for nearby vehicle sources of lifting used for operations on distant objects (e.g. More... | |
| std::vector< item * > | inv_dump () |
| units::mass | weight_carried () const |
| units::volume | volume_carried () const |
| units::mass | weight_carried_reduced_by (const excluded_stacks &without) const |
| units::volume | volume_carried_reduced_by (const excluded_stacks &without) const |
| units::mass | weight_capacity () const override |
| units::volume | volume_capacity () const |
| units::volume | volume_capacity_reduced_by (const units::volume &mod, const excluded_stacks &without={}) const |
| bool | can_pick_volume (const item &it) const |
| bool | can_pick_volume (units::volume volume) const |
| bool | can_pick_weight (const item &it, bool safe=true) const |
| bool | can_pick_weight (units::mass weight, bool safe=true) const |
| bool | can_use (const item &it, const item &context=item()) const |
| Checks if character stats and skills meet minimum requirements for the item. More... | |
| ret_val< bool > | can_wear (const item &it, bool with_equip_change=false) const |
| Check character capable of wearing an item. More... | |
| bool | is_armed () const |
| Returns true if the character is wielding something. More... | |
| virtual bool | wield (item &target)=0 |
| Removes currently wielded item (if any) and replaces it with the target item. More... | |
| ret_val< bool > | can_unwield (const item &it) const |
| Check player capable of unwielding an item. More... | |
| ret_val< bool > | can_swap (const item &it) const |
| Check player capable of swapping the side of a worn item. More... | |
| void | drop_invalid_inventory () |
| std::list< item * > | get_dependent_worn_items (const item &it) const |
| Returns all items that must be taken off before taking off this item. More... | |
| void | drop (item_location loc, const tripoint &where) |
| Drops an item to the specified location. More... | |
| virtual void | drop (const drop_locations &what, const tripoint &target, bool stash=false) |
| virtual bool | has_artifact_with (art_effect_passive effect) const |
| bool | is_wielding (const item &target) const |
| bool | covered_with_flag (const std::string &flag, const body_part_set &parts) const |
| bool | is_waterproof (const body_part_set &parts) const |
| int | leak_level (const std::string &flag) const |
| bool | is_wearing (const item &itm) const |
| Returns true if the player is wearing the item. More... | |
| bool | is_wearing (const itype_id &it) const |
| Returns true if the player is wearing an item of this type. More... | |
| bool | is_wearing_on_bp (const itype_id &it, const bodypart_id &bp) const |
| Returns true if the player is wearing the item on the given body part. More... | |
| bool | worn_with_flag (const std::string &flag, const bodypart_id &bp=bodypart_str_id::NULL_ID()) const |
| Returns true if the player is wearing an item with the given flag. More... | |
| const item * | item_worn_with_flag (const std::string &flag, const bodypart_id &bp=bodypart_str_id::NULL_ID()) const |
| Returns the first worn item with a given flag. More... | |
| std::vector< std::string > | get_overlay_ids () const |
| Returns a list of the IDs of overlays on this character, sorted from "lowest" to "highest". More... | |
| int | get_skill_level (const skill_id &ident) const |
| int | get_skill_level (const skill_id &ident, const item &context) const |
| const SkillLevelMap & | get_all_skills () const |
| SkillLevel & | get_skill_level_object (const skill_id &ident) |
| const SkillLevel & | get_skill_level_object (const skill_id &ident) const |
| void | set_skill_level (const skill_id &ident, int level) |
| void | mod_skill_level (const skill_id &ident, int delta) |
| bool | meets_skill_requirements (const std::map< skill_id, int > &req, const item &context=item()) const |
| Checks whether the character's skills meet the required. More... | |
| bool | meets_skill_requirements (const construction &con) const |
| Checks whether the character's skills meet the required. More... | |
| bool | meets_stat_requirements (const item &it) const |
| Checks whether the character's stats meets the stats required by the item. More... | |
| bool | meets_requirements (const item &it, const item &context=item()) const |
| Checks whether the character meets overall requirements to be able to use the item. More... | |
| std::string | enumerate_unmet_requirements (const item &it, const item &context=item()) const |
| Returns a string of missed requirements (both stats and skills) More... | |
| int | rust_rate () const |
| Returns the player's skill rust rate. More... | |
| int | read_speed (bool return_stat_effect=true) const |
| Returns the player's reading speed. More... | |
| time_point | get_time_died () const |
| return the calendar::turn the character expired More... | |
| void | set_time_died (const time_point &time) |
| set the turn the turn the character died if not already done More... | |
| void | normalize () override |
| Calls Creature::normalize() nulls out the player's weapon Should only be called through player::normalize(), not on it's own! More... | |
| void | die (Creature *nkiller) override |
| Empty function. More... | |
| std::string | get_name () const override |
| std::vector< std::string > | get_grammatical_genders () const override |
| template<typename ... Args> | |
| bool | query_yn (const char *const msg, Args &&... args) const |
| It is supposed to hide the query_yn to simplify player vs. More... | |
| virtual bool | query_yn (const std::string &msg) const =0 |
| bool | is_immune_field (const field_type_id &fid) const override |
| Returns true if we are immune to the field type with the given fid. More... | |
| bool | is_elec_immune () const override |
| Returns true is the player is protected from electric shocks. More... | |
| bool | is_immune_effect (const efftype_id &) const override |
| Returns true if the player is immune to this kind of effect. More... | |
| bool | is_immune_damage (damage_type) const override |
| Returns true if the player is immune to this kind of damage. More... | |
| bool | is_rad_immune () const |
| Returns true if the player is protected from radiation. More... | |
| bool | is_throw_immune () const |
| Returns true if the player is immune to throws. More... | |
| bool | has_nv () |
| Returns true if the player has some form of night vision. More... | |
| float | rest_quality () const |
| Returns >0 if character is sitting/lying and relatively inactive. More... | |
| float | healing_rate (float at_rest_quality) const |
| Average hit points healed per turn. More... | |
| float | healing_rate_medicine (float at_rest_quality, const bodypart_id &bp) const |
| Average hit points healed per turn from healing effects. More... | |
| float | mutation_value (const std::string &val) const |
| Goes over all mutations, gets min and max of a value with given name. More... | |
| social_modifiers | get_mutation_social_mods () const |
| Goes over all mutations, returning the sum of the social modifiers. More... | |
| nc_color | symbol_color () const override |
| Color's character's tile's background. More... | |
| std::string | extended_description () const override |
| void | pick_name (bool bUseDefault=false) |
| Returns a random name from NAMES_*. More... | |
| std::vector< trait_id > | get_base_traits () const |
| Get the idents of all base traits. More... | |
| std::vector< trait_id > | get_mutations (bool include_hidden=true) const |
| Get the idents of all traits/mutations. More... | |
| const std::bitset< NUM_VISION_MODES > & | get_vision_modes () const |
| void | clear_skills () |
| Clear the skills map, setting all levels to 0. More... | |
| void | clear_mutations () |
| Empties the trait and mutations lists. More... | |
| bool | crossed_threshold () const |
| Returns true if the player has crossed a mutation threshold Player can only cross one mutation threshold. More... | |
| void | add_addiction (add_type type, int strength) |
| Adds an addiction to the player. More... | |
| void | rem_addiction (add_type type) |
| Removes an addition from the player. More... | |
| bool | has_addiction (add_type type) const |
| Returns true if the player has an addiction of the specified type. More... | |
| int | addiction_level (add_type type) const |
| Returns the intensity of the specified addiction. More... | |
| void | start_hauling () |
| void | stop_hauling () |
| bool | is_hauling () const |
| bool | has_item_with_flag (const std::string &flag, bool need_charges=false) const |
| std::vector< const item * > | all_items_with_flag (const std::string &flag) const |
| All items that have the given flag (item::has_flag). More... | |
| bool | has_charges (const itype_id &it, int quantity, const std::function< bool(const item &)> &filter=return_true< item >) const |
| std::list< item > | use_amount (itype_id it, int quantity, const std::function< bool(const item &)> &filter=return_true< item >) |
| bool | use_charges_if_avail (const itype_id &it, int quantity) |
| std::list< item > | use_charges (const itype_id &what, int qty, const std::function< bool(const item &)> &filter=return_true< item >) |
| bool | has_fire (int quantity) const |
| void | use_fire (int quantity) |
| void | assign_stashed_activity () |
| bool | check_outbounds_activity (const player_activity &act, bool check_only=false) |
| void | assign_activity (const activity_id &type, int moves=calendar::INDEFINITELY_LONG, int index=-1, int pos=INT_MIN, const std::string &name="") |
| Legacy activity assignment, does not work for any activites using the new activity_actor class and may cause issues with resuming. More... | |
| void | assign_activity (const player_activity &act, bool allow_resume=true) |
| Assigns activity to player, possibly resuming old activity if it's similar enough. More... | |
| bool | has_activity (const activity_id &type) const |
| Check if player currently has a given activity. More... | |
| bool | has_activity (const std::vector< activity_id > &types) const |
| Check if player currently has any of the given activities. More... | |
| void | resume_backlog_activity () |
| void | cancel_activity () |
| void | cancel_stashed_activity () |
| player_activity | get_stashed_activity () const |
| void | set_stashed_activity (const player_activity &act, const player_activity &act_back=player_activity()) |
| bool | has_stashed_activity () const |
| void | initialize_stomach_contents () |
| float | metabolic_rate_base () const |
| Stable base metabolic rate due to traits. More... | |
| float | metabolic_rate () const |
| Current metabolic rate due to traits, hunger, speed, etc. More... | |
| std::string | get_weight_string () const |
| int | get_max_healthy () const |
| float | bmi () const |
| int | bmr () const |
| void | reset_chargen_attributes () |
| int | base_age () const |
| void | set_base_age (int age) |
| void | mod_base_age (int mod) |
| int | age () const |
| std::string | age_string () const |
| int | base_height () const |
| void | set_base_height (int height) |
| void | mod_base_height (int mod) |
| std::string | height_string () const |
| int | height () const |
| units::mass | bodyweight () const |
| units::mass | bionics_weight () const |
| int | get_armor_bash (bodypart_id bp) const override |
| Returns overall bashing resistance for the body_part. More... | |
| int | get_armor_cut (bodypart_id bp) const override |
| Returns overall cutting resistance for the body_part. More... | |
| int | get_armor_bullet (bodypart_id bp) const override |
| Returns overall bullet resistance for the body_part. More... | |
| int | get_armor_bash_base (bodypart_id bp) const override |
| Returns bashing resistance from the creature and armor only. More... | |
| int | get_armor_cut_base (bodypart_id bp) const override |
| Returns cutting resistance from the creature and armor only. More... | |
| int | get_armor_bullet_base (bodypart_id bp) const override |
| Returns cutting resistance from the creature and armor only. More... | |
| int | get_env_resist (bodypart_id bp) const override |
| Returns overall env_resist on a body_part. More... | |
| int | get_armor_acid (bodypart_id bp) const |
| Returns overall acid resistance for the body part. More... | |
| int | get_armor_type (damage_type dt, bodypart_id bp) const override |
| Returns overall resistance to given type on the bod part. More... | |
| std::map< bodypart_id, int > | get_all_armor_type (damage_type dt, const std::map< bodypart_id, std::vector< const item * > > &clothing_map) const |
| int | get_stim () const |
| void | set_stim (int new_stim) |
| void | mod_stim (int mod) |
| int | get_rad () const |
| void | set_rad (int new_rad) |
| void | mod_rad (int mod) |
| int | get_stamina () const |
| int | get_stamina_max () const |
| void | set_stamina (int new_stamina) |
| void | mod_stamina (int mod) |
| void | burn_move_stamina (int moves) |
| float | stamina_move_cost_modifier () const |
| void | update_stamina (int turns) |
| Regenerates stamina. More... | |
| void | on_item_wear (const item &it) |
| Called when an item is worn. More... | |
| void | on_item_takeoff (const item &it) |
| Called when an item is taken off. More... | |
| void | on_worn_item_washed (const item &it) |
| Called when an item is washed. More... | |
| void | on_effect_int_change (const efftype_id &effect_type, int intensity, const bodypart_str_id &bp) override |
| Called when effect intensity has been changed. More... | |
| void | on_mutation_gain (const trait_id &mid) |
| Called when a mutation is gained. More... | |
| void | on_mutation_loss (const trait_id &mid) |
| Called when a mutation is lost. More... | |
| void | on_stat_change (const std::string &stat, int value) override |
| Called when a stat is changed. More... | |
| tripoint | adjacent_tile () const |
| Returns an unoccupied, safe adjacent point. More... | |
| void | wake_up () |
| Removes "sleep" and "lying_down". More... | |
| int | get_shout_volume () const |
| void | shout (std::string msg="", bool order=false) |
| void | vomit () |
| Handles Character vomiting effects. More... | |
| void | healed_bp (int bp, int amount) |
| int | adjust_for_focus (int amount) const |
| void | update_type_of_scent (bool init=false) |
| void | update_type_of_scent (const trait_id &mut, bool gain=true) |
| void | set_type_of_scent (const scenttype_id &id) |
| scenttype_id | get_type_of_scent () const |
| void | restore_scent () |
| restore scent after masked_scent effect run out or is removed by water More... | |
| void | mod_painkiller (int npkill) |
| Modifies intensity of painkillers More... | |
| void | set_painkiller (int npkill) |
| Sets intensity of painkillers More... | |
| int | get_painkiller () const |
| Returns intensity of painkillers More... | |
| void | react_to_felt_pain (int intensity) |
| void | spores () |
| void | blossoms () |
| void | rooted_message () const |
| Handles rooting effects. More... | |
| void | rooted () |
| void | fall_asleep () |
| Adds "sleep" to the player. More... | |
| void | fall_asleep (const time_duration &duration) |
| std::string | is_snuggling () const |
| Checks to see if the player is using floor items to keep warm, and return the name of one such item if so. More... | |
| float | power_rating () const override |
| Returns an approximation of the creature's strength. More... | |
| float | speed_rating () const override |
| Returns an approximate number of tiles this creature can travel per turn. More... | |
| item & | item_with_best_of_quality (const quality_id &qid) |
| Returns the item in the player's inventory with the highest of the specified quality. More... | |
| bool | sees_with_infrared (const Creature &critter) const |
| Check whether the this player can see the other creature with infrared. More... | |
| void | place_corpse () |
| void | place_corpse (const tripoint_abs_omt &om_target) |
| int | run_cost (int base_cost, bool diag=false) const |
| Returns the player's modified base movement cost. More... | |
| const pathfinding_settings & | get_pathfinding_settings () const override |
| Returns settings for pathfinding. More... | |
| std::set< tripoint > | get_path_avoid () const override |
| Returns a set of points we do not want to path through. More... | |
| std::vector< Creature * > | get_hostile_creatures (int range) const |
| Get all hostile creatures currently visible to this player. More... | |
| std::vector< Creature * > | get_visible_creatures (int range) const |
| Returns all creatures that this player can see and that are in the given range. More... | |
| std::string | visible_mutations (int visibility_cap) const |
| Returns an enumeration of visible mutations with colors. More... | |
| player_activity | get_destination_activity () const |
| void | set_destination_activity (const player_activity &new_destination_activity) |
| void | clear_destination_activity () |
| std::map< bodypart_id, int > | warmth (const std::map< bodypart_id, std::vector< const item * > > &clothing_map) const |
| Returns warmth provided by armor, etc. More... | |
| bool | can_use_floor_warmth () const |
| Can the player lie down and cover self with blankets etc. More... | |
| int | floor_warmth (const tripoint &pos) const |
| Final warmth from the floor. More... | |
| int | bodytemp_modifier_traits (bool overheated) const |
| Correction factor of the body temperature due to traits and mutations. More... | |
| int | bodytemp_modifier_traits_floor () const |
| Correction factor of the body temperature due to traits and mutations for player lying on the floor. More... | |
| int | temp_corrected_by_climate_control (int temperature) const |
| Value of the body temperature corrected by climate control. More... | |
| bool | in_sleep_state () const override |
| void | update_vitamins (const vitamin_id &vit) |
| Set vitamin deficiency/excess disease states dependent upon current vitamin levels. More... | |
| int | vitamin_get (const vitamin_id &vit) const |
| Check current level of a vitamin. More... | |
| bool | vitamin_set (const vitamin_id &vit, int qty) |
| Sets level of a vitamin or returns false if id given in vit does not exist. More... | |
| int | vitamin_mod (const vitamin_id &vit, int qty, bool capped=true) |
| Add or subtract vitamins from character storage pools. More... | |
| void | vitamins_mod (const std::map< vitamin_id, int > &, bool capped=true) |
| time_duration | vitamin_rate (const vitamin_id &vit) const |
| Get vitamin usage rate (minutes per unit) accounting for bionics, mutations and effects. More... | |
| int | nutrition_for (const item &comest) const |
| Handles the nutrition value for a comestible. More... | |
| ret_val< edible_rating > | can_eat (const item &food) const |
| Can the food be [theoretically] eaten no matter the consequen ces? More... | |
| ret_val< edible_rating > | will_eat (const item &food, bool interactive=false) const |
| Same as can_eat, but takes consequences into account. More... | |
| bool | can_feed_reactor_with (const item &it) const |
| Determine character's capability of recharging their CBMs. More... | |
| bool | can_feed_furnace_with (const item &it) const |
| rechargeable_cbm | get_cbm_rechargeable_with (const item &it) const |
| int | get_acquirable_energy (const item &it, rechargeable_cbm cbm) const |
| int | get_acquirable_energy (const item &it) const |
| bool | feed_reactor_with (item &it) |
| Recharge CBMs whenever possible. More... | |
| bool | feed_furnace_with (item &it) |
| bool | fuel_bionic_with (item &it) |
| void | modify_stimulation (const islot_comestible &comest) |
| Used to apply stimulation modifications from food and medication. More... | |
| void | modify_fatigue (const islot_comestible &comest) |
| Used to apply fatigue modifications from food and medication. More... | |
| void | modify_radiation (const islot_comestible &comest) |
| Used to apply radiation from food and medication. More... | |
| void | modify_addiction (const islot_comestible &comest) |
| Used to apply addiction modifications from food and medication. More... | |
| void | modify_health (const islot_comestible &comest) |
| Used to apply health modifications from food and medication. More... | |
| bool | consume_effects (item &food) |
| Handles the effects of consuming an item. More... | |
| bool | can_consume (const item &it) const |
| Check character's capability of consumption overall. More... | |
| bool | can_estimate_rot () const |
| True if the character has enough skill (in cooking or survival) to estimate time to rot. More... | |
| bool | can_consume_as_is (const item &it) const |
| Check whether character can consume this very item. More... | |
| bool | can_consume_for_bionic (const item &it) const |
| item & | get_consumable_from (item &it) const |
| Returns a reference to the item itself (if it's consumable), the first of its contents (if it's consumable) or null item otherwise. More... | |
| std::pair< nutrients, nutrients > | compute_nutrient_range (const item &, const recipe_id &, const cata::flat_set< std::string > &extra_flags={}) const |
| Get calorie & vitamin contents for a comestible, taking into account character traits. More... | |
| std::pair< nutrients, nutrients > | compute_nutrient_range (const itype_id &, const cata::flat_set< std::string > &extra_flags={}) const |
| Same, but across arbitrary recipes. More... | |
| morale_type | allergy_type (const item &food) const |
| Returns allergy type or MORALE_NULL if not allergic for this character. More... | |
| nutrients | compute_effective_nutrients (const item &) const |
| bool | wearing_something_on (const bodypart_id &bp) const |
| Returns true if the character is wearing something on the entered body part. More... | |
| bool | is_wearing_helmet () const |
| Returns true if the character is wearing something occupying the helmet slot. More... | |
| int | head_cloth_encumbrance () const |
| Returns the total encumbrance of all SKINTIGHT and HELMET_COMPAT items coveringi the head. More... | |
| double | armwear_factor () const |
| Same as footwear factor, but for arms. More... | |
| int | shoe_type_count (const itype_id &it) const |
| Returns 1 if the player is wearing an item of that count on one foot, 2 if on both, and zero if on neither. More... | |
| double | footwear_factor () const |
| Returns 1 if the player is wearing something on both feet, .5 if on one, and 0 if on neither. More... | |
| bool | is_wearing_shoes (const side &which_side=side::BOTH) const |
| Returns true if the player is wearing something on their feet that is not SKINTIGHT. More... | |
| bool | change_side (item &it, bool interactive=true) |
| Swap side on which item is worn; returns false on fail. More... | |
| bool | change_side (item_location &loc, bool interactive=true) |
| bool | get_check_encumbrance () |
| void | set_check_encumbrance (bool new_check) |
| void | update_morale () |
| Ticks down morale counters and removes them. More... | |
| void | apply_persistent_morale () |
| Ensures persistent morale effects are up-to-date. More... | |
| void | modify_morale (item &food, int nutr=0) |
| Used to apply morale modifications from food and medication. More... | |
| int | get_morale_level () const |
| void | add_morale (const morale_type &type, int bonus, int max_bonus=0, const time_duration &duration=1_hours, const time_duration &decay_start=30_minutes, bool capped=false, const itype *item_type=nullptr) |
| bool | has_morale (const morale_type &type) const |
| int | get_morale (const morale_type &type) const |
| void | rem_morale (const morale_type &type) |
| void | clear_morale () |
| bool | has_morale_to_read () const |
| bool | has_morale_to_craft () const |
| const inventory & | crafting_inventory (bool clear_path) |
| const inventory & | crafting_inventory (const tripoint &src_pos=tripoint_zero, int radius=PICKUP_RANGE, bool clear_path=true) |
| void | invalidate_crafting_inventory () |
| const recipe_subset & | get_learned_recipes () const |
| Returns all known recipes. More... | |
| bool | knows_recipe (const recipe *rec) const |
| void | learn_recipe (const recipe *rec) |
| bool | can_learn_by_disassembly (const recipe &rec) const |
| bool | check_and_recover_morale () |
| Checks permanent morale for consistency and recovers it when an inconsistency is found. More... | |
| std::pair< int, int > | fun_for (const item &comest) const |
| Handles the enjoyability value for a comestible. More... | |
| void | suffer () |
| Handles a large number of timers decrementing and other randomized effects. More... | |
| bool | irradiate (float rads, bool bypass=false) |
| Handles mitigation and application of radiation. More... | |
| void | mend (int rate_multiplier) |
| Handles the chance for broken limbs to spontaneously heal to 1 HP. More... | |
| void | sound_hallu () |
| Creates an auditory hallucination. More... | |
| void | drench (int saturation, const body_part_set &flags, bool ignore_waterproof) |
| Drenches the player with water, saturation is the percent gotten wet. More... | |
| void | apply_wetness_morale (int temperature) |
| Recalculates morale penalty/bonus from wetness based on mutations, equipment and temperature. More... | |
| std::vector< std::string > | short_description_parts () const |
| std::string | short_description () const |
| int | print_info (const catacurses::window &w, int vStart, int vLines, int column) const override |
| Write information about this creature. More... | |
| bool | can_hear (const tripoint &source, int volume) const |
| float | hearing_ability () const |
| bool | knows_trap (const tripoint &pos) const |
| void | add_known_trap (const tripoint &pos, const trap &t) |
| nc_color | bodytemp_color (int bp) const |
| Define color for displaying the body temperature. More... | |
| bool | sees (const tripoint &t, bool is_player=false, int range_mod=0) const override |
| bool | sees (const Creature &critter) const override |
| The functions check whether this creature can see the target. More... | |
| Attitude | attitude_to (const Creature &other) const override |
| Attitude (of this creature) towards another creature. More... | |
| int | get_lowest_hp () const |
| bool | has_weapon () const override |
| void | shift_destination (const point &shift) |
| void | set_destination (const std::vector< tripoint > &route, const player_activity &new_destination_activity=player_activity()) |
| void | clear_destination () |
| bool | has_distant_destination () const |
| bool | is_auto_moving () const |
| bool | has_destination () const |
| bool | has_destination_activity () const |
| void | start_destination_activity () |
| std::vector< tripoint > & | get_auto_move_route () |
| action_id | get_next_auto_move_direction () |
| bool | defer_move (const tripoint &next) |
| std::map< bodypart_id, float > | bodypart_exposure () |
| Map body parts to their total exposure, from 0.0 (fully covered) to 1.0 (buck naked). More... | |
| bool | pour_into (item &container, item &liquid) |
| Try to pour the given liquid into the given container/vehicle. More... | |
| bool | pour_into (vehicle &veh, item &liquid) |
Public Member Functions inherited from Creature | |
| virtual | ~Creature () |
| virtual bool | is_player () const |
| virtual bool | is_avatar () const |
| virtual bool | is_npc () const |
| virtual bool | is_monster () const |
| virtual monster * | as_monster () |
| virtual const monster * | as_monster () const |
| virtual npc * | as_npc () |
| virtual const npc * | as_npc () const |
| virtual player * | as_player () |
| virtual const player * | as_player () const |
| virtual avatar * | as_avatar () |
| virtual const avatar * | as_avatar () const |
| virtual bool | is_fake () const |
| Returns true for non-real Creatures used temporarily; i.e. More... | |
| virtual void | set_fake (bool fake_value) |
| Sets a Creature's fake boolean. More... | |
| virtual void | bleed () const |
| Adds an appropriate blood splatter. More... | |
| virtual float | dodge_roll ()=0 |
| virtual float | stability_roll () const =0 |
| virtual bool | avoid_trap (const tripoint &pos, const trap &tr) const =0 |
| Called when a creature triggers a trap, returns true if they don't set it off. More... | |
| Creature * | auto_find_hostile_target (int range, int &boo_hoo, int area=0) |
| For fake-players (turrets, mounted turrets) this functions chooses a target. More... | |
| double | ranged_target_size () const |
| Size of the target this creature presents to ranged weapons. More... | |
| void | knock_back_from (const tripoint &p) |
| virtual void | knock_back_to (const tripoint &to)=0 |
| int | size_melee_penalty () const |
| virtual int | deal_melee_attack (Creature *source, int hitroll) |
| virtual void | deal_melee_hit (Creature *source, int hit_spread, bool critical_hit, const damage_instance &dam, dealt_damage_instance &dealt_dam) |
| virtual void | deal_projectile_attack (Creature *source, dealt_projectile_attack &attack) |
| Attempts to harm a creature with a projectile. More... | |
| virtual void | deal_damage_handle_type (const damage_unit &du, bodypart_id bp, int &damage, int &pain) |
| virtual void | on_dodge (Creature *source, float difficulty)=0 |
| This creature just dodged an attack - possibly special/ranged attack - from source. More... | |
| virtual bool | digging () const |
| virtual bool | is_underwater () const |
| virtual bool | is_hallucination () const =0 |
| virtual bool | is_dead_state () const =0 |
| bool | is_dangerous_fields (const field &fld) const |
| Returns true if there is a field in the field set that is dangerous to us. More... | |
| bool | is_dangerous_field (const field_entry &entry) const |
| Returns true if the given field entry is dangerous to us. More... | |
| virtual float | fall_damage_mod () const =0 |
| Returns multiplier on fall damage at low velocity (knockback/pit/1 z-level, not 5 z-levels) More... | |
| virtual int | impact (int force, const tripoint &pos)=0 |
| Deals falling/collision damage with terrain/creature at pos. More... | |
| void | check_dead_state () |
| This function checks the creatures is_dead_state and (if true) calls die. More... | |
| void | add_effect (const effect &eff, bool force=false, bool deferred=false) |
| virtual void | add_effect (const efftype_id &eff_id, const time_duration &dur, const bodypart_str_id &bp, int intensity=0, bool force=false, bool deferred=false) |
| Adds or modifies an effect. More... | |
| void | add_effect (const efftype_id &eff_id, const time_duration &dur, body_part bp=num_bp, int intensity=0, bool force=false, bool deferred=false) |
| bool | add_env_effect (const efftype_id &eff_id, body_part vector, int strength, const time_duration &dur, body_part bp=num_bp, int intensity=1, bool force=false) |
| Gives chance to save via environmental resist, returns false if resistance was successful. More... | |
| bool | add_env_effect (const efftype_id &eff_id, body_part vector, int strength, const time_duration &dur, body_part bp, bool REMOVED, int intensity=1, bool force=false)=delete |
| bool | remove_effect (const efftype_id &eff_id, body_part bp=num_bp) |
| Removes a listed effect. More... | |
| virtual bool | remove_effect (const efftype_id &eff_id, const bodypart_str_id &bp) |
| void | clear_effects () |
| Remove all effects. More... | |
| bool | has_effect (const efftype_id &eff_id, body_part bp=num_bp) const |
| Check if creature has the matching effect. More... | |
| bool | has_effect (const efftype_id &eff_id, const bodypart_str_id &bp) const |
| bool | has_effect_with_flag (const std::string &flag, body_part bp=num_bp) const |
| Check if creature has any effect with the given flag. More... | |
| const effect & | get_effect (const efftype_id &eff_id, body_part bp=num_bp) const |
| Return the effect that matches the given arguments exactly. More... | |
| effect & | get_effect (const efftype_id &eff_id, body_part bp=num_bp) |
| std::vector< const effect * > | get_all_effects_of_type (const efftype_id &eff_id) const |
| Returns pointers to all effects matching given type. More... | |
| time_duration | get_effect_dur (const efftype_id &eff_id, body_part bp=num_bp) const |
| Returns the duration of the matching effect. More... | |
| int | get_effect_int (const efftype_id &eff_id, body_part bp=num_bp) const |
| Returns the intensity of the matching effect. More... | |
| bool | resists_effect (const effect &e) const |
| Returns true if the creature resists an effect. More... | |
| void | set_value (const std::string &key, const std::string &value) |
| void | remove_value (const std::string &key) |
| std::string | get_value (const std::string &key) const |
| void | process_effects () |
| Processes through all the effects on the Creature. More... | |
| virtual void | process_effects_internal ()=0 |
| Processes effects according to class (monster, player) More... | |
| virtual void | mod_pain (int npain) |
| virtual void | mod_pain_noresist (int npain) |
| virtual void | set_pain (int npain) |
| virtual int | get_pain () const |
| virtual int | get_perceived_pain () const |
| int | get_moves () const |
| void | mod_moves (int nmoves) |
| void | set_moves (int nmoves) |
| virtual Creature * | get_killer () const |
| virtual int | get_num_blocks () const |
| virtual int | get_num_dodges () const |
| virtual int | get_num_blocks_bonus () const |
| virtual int | get_num_dodges_bonus () const |
| virtual int | get_num_dodges_base () const |
| virtual int | get_armor_bash_bonus () const |
| virtual int | get_armor_cut_bonus () const |
| virtual int | get_armor_bullet_bonus () const |
| virtual float | get_melee () const =0 |
| virtual float | get_hit () const |
| virtual int | get_hp (const bodypart_id &bp) const |
| virtual int | get_hp () const |
| virtual int | get_hp_max (const bodypart_id &bp) const |
| virtual int | get_hp_max () const |
| virtual int | hp_percentage () const =0 |
| virtual bool | has_flag (const m_flag) const |
| virtual bool | uncanny_dodge () |
| anatomy_id | get_anatomy () const |
| void | set_anatomy (anatomy_id anat) |
| bodypart_id | get_random_body_part (bool main=false) const |
| std::vector< bodypart_id > | get_all_body_parts (bool only_main=false) const |
| Returns body parts this creature have. More... | |
| const std::map< bodypart_str_id, bodypart > & | get_body () const |
| void | set_body () |
| bodypart * | get_part (const bodypart_id &id) |
| bodypart | get_part (const bodypart_id &id) const |
| int | get_part_hp_cur (const bodypart_id &id) const |
| int | get_part_hp_max (const bodypart_id &id) const |
| int | get_part_healed_total (const bodypart_id &id) const |
| void | set_part_hp_cur (const bodypart_id &id, int set) |
| void | set_part_hp_max (const bodypart_id &id, int set) |
| void | set_part_healed_total (const bodypart_id &id, int set) |
| void | mod_part_hp_cur (const bodypart_id &id, int mod) |
| void | mod_part_hp_max (const bodypart_id &id, int mod) |
| void | mod_part_healed_total (const bodypart_id &id, int mod) |
| void | set_all_parts_hp_cur (int set) |
| void | set_all_parts_hp_to_max () |
| virtual int | get_speed_base () const |
| virtual int | get_speed_bonus () const |
| virtual int | get_block_bonus () const |
| virtual float | get_dodge_bonus () const |
| virtual float | get_hit_bonus () const |
| virtual void | set_num_blocks_bonus (int nblocks) |
| virtual void | mod_num_dodges_bonus (int ndodges) |
| virtual void | set_armor_bash_bonus (int nbasharm) |
| virtual void | set_armor_cut_bonus (int ncutarm) |
| virtual void | set_armor_bullet_bonus (int nbulletarm) |
| virtual void | set_speed_base (int nspeed) |
| virtual void | set_speed_bonus (int nspeed) |
| virtual void | set_block_bonus (int nblock) |
| virtual void | mod_speed_bonus (int nspeed) |
| virtual void | mod_block_bonus (int nblock) |
| virtual void | set_dodge_bonus (float ndodge) |
| virtual void | set_hit_bonus (float nhit) |
| virtual void | mod_dodge_bonus (float ndodge) |
| virtual void | mod_hit_bonus (float nhit) |
| void | draw (const catacurses::window &w, const point &origin, bool inverted) const |
| void | draw (const catacurses::window &w, const tripoint &origin, bool inverted) const |
| void | describe_infrared (std::vector< std::string > &buf) const |
| Describe this creature as seen by the avatar via infrared vision. More... | |
| void | describe_specials (std::vector< std::string > &buf) const |
| Describe this creature as detected by the avatar's special senses. More... | |
| virtual void | add_msg_if_player (const std::string &) const |
| virtual void | add_msg_if_player (const game_message_params &, const std::string &) const |
| void | add_msg_if_player (const translation &) const |
| void | add_msg_if_player (const game_message_params &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const translation &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const translation &msg, Args &&... args) const |
| virtual void | add_msg_if_npc (const std::string &) const |
| virtual void | add_msg_if_npc (const game_message_params &, const std::string &) const |
| void | add_msg_if_npc (const translation &) const |
| void | add_msg_if_npc (const game_message_params &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const translation &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const game_message_params ¶ms, const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const game_message_params ¶ms, const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const game_message_params ¶ms, const translation &msg, Args &&... args) const |
| virtual void | add_msg_player_or_npc (const std::string &, const std::string &) const |
| virtual void | add_msg_player_or_npc (const game_message_params &, const std::string &, const std::string &) const |
| void | add_msg_player_or_npc (const translation &, const translation &) const |
| void | add_msg_player_or_npc (const game_message_params &, const translation &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const char *const player_msg, const char *const npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const std::string &player_msg, const std::string &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const translation &player_msg, const translation &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const char *const player_msg, const char *const npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const translation &player_msg, const translation &npc_msg, Args &&... args) const |
| virtual void | add_msg_player_or_say (const std::string &, const std::string &) const |
| virtual void | add_msg_player_or_say (const game_message_params &, const std::string &, const std::string &) const |
| void | add_msg_player_or_say (const translation &, const translation &) const |
| void | add_msg_player_or_say (const game_message_params &, const translation &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const char *const player_msg, const char *const npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const std::string &player_msg, const std::string &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const translation &player_msg, const translation &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const char *const player_msg, const char *const npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const translation &player_msg, const translation &npc_speech, Args &&... args) const |
| virtual nc_color | basic_symbol_color () const =0 |
| virtual bool | is_symbol_highlighted () const |
| effects_map | get_all_effects () const |
| body_part | select_body_part (Creature *source, int hit_roll) const |
| std::string | replace_with_npc_name (std::string input) const |
| This function replaces the "<npcname>" substring with the disp_name of this creature. More... | |
Public Member Functions inherited from visitable< Character > | |
| VisitResponse | visit_items (const std::function< VisitResponse(item *, item *)> &func) |
| Traverses this object and any child items contained using a visitor pattern. More... | |
| VisitResponse | visit_items (const std::function< VisitResponse(const item *, const item *)> &func) const |
| VisitResponse | visit_items (const std::function< VisitResponse(item *)> &func) |
| Lightweight version which provides only the current node. More... | |
| VisitResponse | visit_items (const std::function< VisitResponse(const item *)> &func) const |
| item * | find_parent (const item &it) |
| Determine the immediate parent container (if any) for an item. More... | |
| const item * | find_parent (const item &it) const |
| std::vector< item * > | parents (const item &it) |
| Returns vector of parent containers (if any) starting with the innermost. More... | |
| std::vector< const item * > | parents (const item &it) const |
| bool | has_item (const item &it) const |
| Returns true if this visitable instance contains the item. More... | |
| bool | has_item_with (const std::function< bool(const item &)> &filter) const |
| Returns true if any item (including those within a container) matches the filter. More... | |
| bool | has_quality (const quality_id &qual, int level=1, int qty=1) const |
| Returns true if instance has amount (or more) items of at least quality level. More... | |
| int | max_quality (const quality_id &qual) const |
| Return maximum tool quality level provided by instance or INT_MIN if not found. More... | |
| int | charges_of (const itype_id &what, int limit=INT_MAX, const std::function< bool(const item &)> &filter=return_true< item >, std::function< void(int)> visitor=nullptr) const |
| Count maximum available charges from this instance and any contained items. More... | |
| int | amount_of (const itype_id &what, bool pseudo=true, int limit=INT_MAX, const std::function< bool(const item &)> &filter=return_true< item >) const |
| Count items matching id including both this instance and any contained items. More... | |
| bool | has_amount (const itype_id &what, int qty, bool pseudo=true, const std::function< bool(const item &)> &filter=return_true< item >) const |
| Check instance provides at least qty of an item (. More... | |
| std::vector< item * > | items_with (const std::function< bool(const item &)> &filter) |
| Returns all items (including those within a container) matching the filter. More... | |
| std::vector< const item * > | items_with (const std::function< bool(const item &)> &filter) const |
| std::list< item > | remove_items_with (const std::function< bool(const item &)> &filter, int count=INT_MAX) |
| Removes items contained by this instance which match the filter. More... | |
| item | remove_item (item &it) |
| Removes and returns the item which must be contained by this instance. More... | |
Static Public Member Functions | |
| static hp_part | bp_to_hp (body_part bp) |
| Converts a body_part to an hp_part. More... | |
| static body_part | hp_to_bp (hp_part hpart) |
| Converts an hp_part to a body_part. More... | |
| static int | worn_position_to_index (int position) |
| static int | floor_bedding_warmth (const tripoint &pos) |
| Warmth from terrain, furniture, vehicle furniture and traps. More... | |
| static int | floor_item_warmth (const tripoint &pos) |
| Warmth from clothing on the floor. More... | |
Static Public Member Functions inherited from Creature | |
| static std::string | attitude_raw_string (Attitude att) |
| Simplified attitude string for unlocalized needs. More... | |
| static const std::pair< translation, nc_color > & | get_attitude_ui_data (Attitude att) |
| Creature Attitude as String and color. More... | |
| static void | load_hit_range (const JsonObject &) |
| static void | reset_hit_range () |
Static Public Attributes | |
| static const std::vector< material_id > | fleshy = { material_id( "flesh" ), material_id( "hflesh" ) } |
Static Public Attributes inherited from Creature | |
| static const std::map< std::string, m_size > | size_map |
| static const std::set< material_id > | cmat_flesh |
| static const std::set< material_id > | cmat_fleshnveg |
| static const std::set< material_id > | cmat_flammable |
| static const std::set< material_id > | cmat_flameres |
| static std::vector< int > | dispersion_for_even_chance_of_good_hit = default_dispersion_for_ecogh |
Protected Member Functions | |
| void | do_skill_rust () |
| void | apply_mods (const trait_id &mut, bool add_remove) |
| Applies stat mods to character. More... | |
| char_encumbrance_data | calc_encumbrance () const |
| Recalculate encumbrance for all body parts. More... | |
| char_encumbrance_data | calc_encumbrance (const item &new_item) const |
Recalculate encumbrance for all body parts as if new_item was also worn. More... | |
| void | mut_cbm_encumb (char_encumbrance_data &vals) const |
| Applies encumbrance from mutations and bionics only. More... | |
| std::list< item >::iterator | position_to_wear_new_item (const item &new_item) |
| Return the position in the worn list where new_item would be put by default. More... | |
| void | item_encumb (char_encumbrance_data &vals, const item &new_item) const |
| Applies encumbrance from items only If new_item is not null, then calculate under the asumption that it is added to existing work items. More... | |
| void | on_damage_of_type (int adjusted_damage, damage_type type, const bodypart_id &bp) override |
| Character () | |
| Character (Character &&) | |
| Character & | operator= (Character &&) |
| void | store (JsonOut &json) const |
| Load variables from json into object. More... | |
| void | load (const JsonObject &data) |
| Gather variables for saving. More... | |
Protected Member Functions inherited from Creature | |
| void | set_killer (Creature *killer) |
| virtual void | process_one_effect (effect &e, bool is_new)=0 |
| Processes one effect on the Creature. More... | |
| Creature () | |
| Creature (const Creature &)=default | |
| Creature (Creature &&)=default | |
| Creature & | operator= (const Creature &)=default |
| Creature & | operator= (Creature &&)=default |
| void | store (JsonOut &jsout) const |
| These two functions are responsible for storing and loading the members of this class to/from json data. More... | |
| void | load (const JsonObject &jsin) |
Protected Attributes | |
| std::array< std::array< int, NUM_WATER_TOLERANCE >, num_bp > | mut_drench |
| tripoint | position |
| int | str_bonus = 0 |
| Bonuses to stats, calculated each turn. More... | |
| int | dex_bonus = 0 |
| int | per_bonus = 0 |
| int | int_bonus = 0 |
| int | healthy = 0 |
| How healthy the character is. More... | |
| int | healthy_mod = 0 |
| int | init_age = 25 |
| age in years at character creation More... | |
| int | init_height = 175 |
| height at character creation More... | |
| m_size | size_class = MS_MEDIUM |
| Size class of character. More... | |
| trap_map | known_traps |
| pimpl< char_encumbrance_data > | encumbrance_cache |
| std::map< std::string, double > | cached_info |
| bool | bio_soporific_powered_at_last_sleep_check = false |
| time_point | last_sleep_check = calendar::turn_zero |
| last time we checked for sleep More... | |
| std::map< faction_id, std::pair< int, time_point > > | warning_record |
| warnings from a faction about bad behavior More... | |
| std::unordered_map< trait_id, trait_data > | my_mutations |
| Traits / mutations of the character. More... | |
| std::unordered_set< trait_id > | my_traits |
| Contains mutation ids of the base traits. More... | |
| std::vector< const mutation_branch * > | cached_mutations |
| Pointers to mutation branches in my_mutations. More... | |
| pimpl< SkillLevelMap > | _skills |
| Character skills. More... | |
| pimpl< SkillLevelMap > | autolearn_skills_stamp |
| Stamp of character skills. More... | |
| pimpl< recipe_subset > | learned_recipes |
| Subset of learned recipes. More... | |
| std::bitset< NUM_VISION_MODES > | vision_mode_cache |
| float | nv_range = 0 |
| int | sight_max = 0 |
| time_point | time_died = calendar::before_time_starts |
| pimpl< pathfinding_settings > | path_settings |
| Cache for pathfinding settings. More... | |
| int | faction_api_version = 2 |
| faction_id | fac_id |
| faction * | my_fac = nullptr |
| character_movemode | move_mode = CMM_WALK |
| std::map< vitamin_id, int > | vitamin_levels |
| Current deficiency/excess quantity for each vitamin. More... | |
| pimpl< player_morale > | morale |
| pimpl< enchantment > | enchantment_cache |
| std::unordered_map< point_abs_omt, time_duration > | overmap_time |
| Amount of time the player has spent in each overmap tile. More... | |
Protected Attributes inherited from Creature | |
| Creature * | killer = nullptr |
| pimpl< effects_map > | effects |
| std::unordered_map< std::string, std::string > | values |
| int | num_blocks = 0 |
| int | num_dodges = 0 |
| int | num_blocks_bonus = 0 |
| int | num_dodges_bonus = 0 |
| int | armor_bash_bonus = 0 |
| int | armor_cut_bonus = 0 |
| int | armor_bullet_bonus = 0 |
| int | speed_base = 0 |
| int | speed_bonus = 0 |
| float | dodge_bonus = 0.0 |
| int | block_bonus = 0 |
| float | hit_bonus = 0.0 |
| bool | fake = false |
Private Member Functions | |
| bool | valid_aoe_technique (Creature &t, const ma_technique &technique) |
| Check if an area-of-effect technique has valid targets. More... | |
| bool | valid_aoe_technique (Creature &t, const ma_technique &technique, std::vector< Creature * > &targets) |
| int | get_mod (const trait_id &mut, const std::string &arg) const |
| Retrieves a stat mod of a mutation. More... | |
| void | apply_skill_boost () |
| Applies skill-based boosts to stats. More... | |
| void | old_mutate () |
| void | suffer_water_damage (const mutation_branch &mdata) |
| suffer() subcalls More... | |
| void | suffer_mutation_power (const mutation_branch &mdata, Character::trait_data &tdata) |
| void | suffer_while_underwater () |
| void | suffer_from_addictions () |
| void | suffer_while_awake (int current_stim) |
| void | suffer_from_chemimbalance () |
| void | suffer_from_schizophrenia () |
| void | suffer_from_asthma (int current_stim) |
| void | suffer_in_sunlight () |
| void | suffer_from_sunburn () |
| void | suffer_from_other_mutations () |
| void | suffer_from_radiation () |
| void | suffer_from_bad_bionics () |
| void | suffer_from_artifacts () |
| void | suffer_from_stimulants (int current_stim) |
| void | suffer_without_sleep (int sleep_deprivation) |
| bool | is_visible_in_range (const Creature &critter, int range) const |
| Check whether the other creature is in range and can be seen by this creature. More... | |
Private Attributes | |
| player_activity | destination_activity |
| character_id | id |
| units::energy | power_level |
| units::energy | max_power_level |
| int | stored_calories = 0 |
| Needs (hunger, starvation, thirst, fatigue, etc.) More... | |
| int | thirst = 0 |
| int | stamina = 0 |
| int | fatigue = 0 |
| int | sleep_deprivation = 0 |
| bool | check_encumbrance = true |
| int | stim = 0 |
| int | pkill = 0 |
| int | radiation = 0 |
| std::vector< tripoint > | auto_move_route |
| cata::optional< tripoint > | next_expected_position |
| scenttype_id | type_of_scent |
| struct weighted_int_list< std::string > | melee_miss_reasons |
| int | cached_moves = 0 |
| tripoint | cached_position |
| inventory | cached_crafting_inventory |
Additional Inherited Members | |
Related Functions inherited from visitable< Character > | |
| VisitResponse | visit_items (const std::function< VisitResponse(const item *, const item *)> &func) const |
| VisitResponse | visit_items (const std::function< VisitResponse(const item *)> &func) const |
| VisitResponse | visit_items (const std::function< VisitResponse(item *)> &func) |
| VisitResponse | visit_items (const std::function< VisitResponse(item *, item *)> &func) |
| item * | find_parent (const item &it) |
| const item * | find_parent (const item &it) const |
| std::vector< item * > | parents (const item &it) |
| std::vector< const item * > | parents (const item &it) const |
| std::vector< item * > | items_with (const std::function< bool(const item &)> &filter) |
| std::vector< const item * > | items_with (const std::function< bool(const item &)> &filter) const |
| std::list< item > | remove_items_with (const std::function< bool(const item &e)> &filter, int count) |
Definition at line 202 of file character.h.
| using Character::trap_map = std::map<tripoint, std::string> |
Definition at line 1994 of file character.h.
|
strong |
| Enumerator | |
|---|---|
| impossible | |
| uncomfortable | |
| neutral | |
| slightly_comfortable | |
| comfortable | |
| very_comfortable | |
Definition at line 231 of file character.h.
| Enumerator | |
|---|---|
| WT_IGNORED | |
| WT_NEUTRAL | |
| WT_GOOD | |
| NUM_WATER_TOLERANCE | |
Definition at line 773 of file character.h.
|
delete |
|
overridedefault |
|
protected |
Definition at line 394 of file character.cpp.
|
protecteddefault |
|
overridevirtual |
Runs through all bionics and armor on a part and reduces damage through their armor_absorb.
Implements Creature.
Definition at line 8151 of file character.cpp.
References _, scrollingcombattext::add(), Creature::add_effect(), map::add_item_or_charges(), Creature::add_msg_if_player(), item_contents::all_items_top(), damage_unit::amount, armor_absorb(), armor_enchantment_adjust(), bio_ads, bionic_at_index(), item::burn(), bionic::charge_timer, item::contents, item::covers(), damage_instance::damage_units, deactivate_bionic(), destroyed_armor_msg(), drop_invalid_inventory(), DT_BASH, DT_BULLET, DT_CUT, DT_HEAT, DT_STAB, effect_onfire, bionic::energy_stored, time_duration::from_turns(), g, get_bionics(), get_map(), has_active_bionic(), has_trait(), bionic::incapacitated_time, bionic::info(), item_armor_enchantment_adjust(), m_bad, m_info, m_neutral, damage_instance::mult_damage(), bionic_data::name, NORTH, item::on_takeoff(), passive_absorb_hit(), pos(), posx(), posy(), remove_color_tags(), roll_remainder(), SCT, item::tname(), units::to_kilojoule(), trait_HOLLOW_BONES, trait_LIGHT_BONES, damage_unit::type, and worn.
| void Character::action_taken | ( | ) |
Called after every action, invalidates player caches.
Definition at line 877 of file character.cpp.
References nv_cached.
Referenced by game::do_turn().
| bool Character::activate_bionic | ( | int | b, |
| bool | eff_only = false |
||
| ) |
Handles bionic activation effects of the entered bionic, returns if anything activated.
Definition at line 530 of file bionics.cpp.
References _, item::active, sounds::activity, projectile::add_effect(), Creature::add_effect(), map::add_field(), map::add_item_or_charges(), Creature::add_msg_if_player(), shockwave_data::affects_player, bionic::ammo_count, bionic::ammo_loaded, item::ammo_set(), apply_damage(), Creature::as_avatar(), b, map::bash(), item_stack::begin(), bio_adrenaline, bio_blood_anal, bio_blood_filter, bio_cqb, bio_earplugs, bio_ears, bio_emp, bio_evap, bio_flashbang, bio_geiger, bio_hydraulics, bio_jointservo, bio_lighter, bio_lockpick, bio_magnet, bio_meteorologist, bio_plutdump, bio_probability_travel, bio_radscrubber, bio_remote, bio_resonator, bio_shockwave, bio_teleport, bio_time_freeze, bio_tools, bio_torsionratchet, bio_water_extractor, burn_fuel(), bionic_data::charge_time, bionic::charge_timer, item::charges, choose_adjacent(), colorize(), sounds::combat, conduct_blood_analysis(), liquid_handler::consume_liquid(), convert_velocity(), shockwave_data::dam_mult, dispose_item(), effect_adrenaline, effect_badpoison, effect_bloodworms, effect_cig, effect_cocaine_high, effect_datura, effect_dermatik, effect_drunk, effect_fungus, effect_hallu, effect_iodine, effect_meth, effect_pblue, effect_pkill1, effect_pkill2, effect_pkill3, effect_pkill_l, effect_poison, effect_stung, effect_teleglow, effect_took_flumed, effect_took_prozac, effect_took_prozac_bad, effect_took_xanax, effect_visuals, effect_weed_high, explosion_handler::emp_blast(), bionic_data::enchantments, item_stack::end(), dealt_projectile_attack::end_point, enough_power_for(), map_stack::erase(), f_null, bionic_data::fake_item, fd_fire, avatar_action::fire_ranged_bionic(), avatar_action::fire_wielded_weapon(), flag_BIONIC_GUN, flag_BIONIC_TOGGLED, flag_BIONIC_WEAPON, flag_CABLE_SPOOL(), flag_NO_UNWIELD(), flag_SEALED(), explosion_handler::flashbang(), shockwave_data::force, force_comedown(), units::from_kilojoule(), g, get_dirstring(), Creature::get_effect(), get_local_humidity(), get_local_windchill(), get_local_windpower(), get_lockpicking_open_result(), get_map(), get_power_level(), weather_manager::get_precise(), get_rad(), Creature::get_value(), get_weather(), global_omt_location(), has_active_bionic(), Creature::has_effect(), bionic_data::has_flag(), item::has_flag(), map::has_flag(), map::has_items(), w_point::humidity, map::i_at(), bionic::id, projectile::impact, bionic::incapacitated_time, bionic::info(), invalidate_crafting_inventory(), item::invlet, invoke_item(), bionic::is_auto_start_keep_full(), string_id< T >::is_empty(), map::is_flammable(), is_mounted(), item::is_null(), bionic_data::is_remote_fueled, visitable< Character >::items_with(), itype_water_clean, m_bad, m_good, m_info, m_mixed, m_neutral, martial_arts_data, Creature::mod_moves(), mod_power_level(), mod_rad(), my_bionics, bionic_data::name, lockpicking_open_result::new_furn_type, lockpicking_open_result::new_ter_type, one_in(), lockpicking_open_result::open_message, overmap_buffer, damage_instance::physical(), map::points_in_radius(), pos(), bionic_data::power_activate, bionic::powered, w_point::pressure, print_humidity(), print_pressure(), print_temperature(), projectile_attack(), query_yn(), shockwave_data::radius, projectile::range, reactor_plut, recalculate_enchantment_cache(), Creature::remove_effect(), reset(), reset_encumbrance(), rl_dist(), rng(), set_painkiller(), set_power_level(), set_rad(), set_stim(), explosion_handler::shockwave(), slow_rad, sounds::sound(), projectile::speed, calendar::start_of_cataclysm, string_format(), shockwave_data::stun, behavior::success, t_null, tank_plut, teleport::teleport(), w_point::temperature, overmapbuffer::ter(), item::tname(), units::to_fahrenheit(), units::to_kilojoule(), calendar::turn, map::veh_at(), velocity_units(), VU_WIND, weapon, and weight_capacity().
Referenced by npc::activate_bionic_by_id(), add_bionic(), player::power_bionics(), and npc::use_bionic_by_id().
| void Character::activate_mutation | ( | const trait_id & | mutation | ) |
Definition at line 470 of file mutation.cpp.
References _, ACT_TREE_COMMUNION, activity, Creature::add_msg_if_player(), assign_activity(), blossoms(), can_use_mutation_warn(), mutation_branch::enchantments, fd_web, avatar_action::fire_ranged_mutation(), monster::friendly, units::from_joule(), g, global_omt_location(), has_trait(), i_add_or_drop(), invoke_item(), string_id< T >::is_empty(), itype_id, m_bad, m_good, m_info, mod_max_power_level(), Creature::mod_moves(), mod_power_level(), mtype_id, mutation_spend_resources(), my_mutations, string_id< T >::obj(), one_in(), overmap_buffer, pos(), Character::trait_data::powered, print_health(), query_int(), mutation_branch::ranged_mutation, mutation_branch::ranged_mutation_message(), recalculate_enchantment_cache(), rng(), mutation_branch::spawn_item, mutation_branch::spawn_item_message(), spores(), switch_mutations(), overmapbuffer::ter(), trait_BURROW, trait_DEBUG_BIONIC_POWER, trait_DEBUG_BIONIC_POWERGEN, trait_M_BLOOM, trait_M_FERTILE, trait_M_PROVENANCE, trait_NAUSEA, trait_ROOTS2, trait_ROOTS3, trait_SELFAWARE, trait_SLIMESPAWNER, trait_TREE_COMMUNION, trait_VOMITOUS, trait_WEB_WEAVER, mutation_branch::transform, player_activity::values, and vomit().
Referenced by player::power_mutations(), and player::power_mutations_ui().
| float Character::active_light | ( | ) | const |
Returns character luminosity based on the brightest active item they are carrying.
Definition at line 6377 of file character.cpp.
References AEP_GLOW, bio_flashlight, bio_tattoo_led, effect_glowing, effect_glowy_led, flag_ALLOWS_NATURAL_ATTACKS(), flag_AURA(), flag_PERSONAL(), flag_SEMITANGIBLE(), item::getlight_emit(), has_active_bionic(), has_artifact_with(), Creature::has_effect(), visitable< Character >::has_item_with(), my_mutations, and worn.
Referenced by map::apply_character_light(), and character_funcs::fine_detail_vision_mod().
| void Character::add_addiction | ( | add_type | type, |
| int | strength | ||
| ) |
Adds an addiction to the player.
Definition at line 1889 of file suffer.cpp.
References add_msg(), addiction_type_name(), addictions, disp_name(), g, gains_addiction, getID(), has_trait(), m_debug, MAX_ADDICTION_LEVEL, NONE, rng(), trait_ADDICTIVE, trait_NONADDICTIVE, and type.
Referenced by iexamine::flower_poppy(), marloss_common(), and modify_addiction().
| void Character::add_bionic | ( | const bionic_id & | b | ) |
Adds a bionic to my_bionics[].
Definition at line 2523 of file bionics.cpp.
References _, activate_bionic(), add_bionic(), Creature::add_msg_if_player(), Creature::as_player(), b, bio_ears, bio_power_storage, bio_power_storage_mkII, bio_tools, debugmsg, mutation_branch::desc(), get_free_invlet(), spell::get_level(), has_bionic(), has_trait(), m_good, magic, mod_max_power_level(), my_bionics, on_mutation_gain(), recalc_sight_limits(), recalculate_enchantment_cache(), reset_encumbrance(), spell::set_level(), set_mutation(), spell_type::spell_class, and units::to_kilojoule().
Referenced by add_bionic(), bionics_install_failure(), avatar::create(), deactivate_bionic(), player::load(), perform_install(), and npc::randomize().
Definition at line 10247 of file character.cpp.
References get_map(), map::getabs(), trap::id, trap::is_null(), known_traps, pos(), and string_id< T >::str().
Referenced by vehicle::handle_trap(), place_and_add_as_known(), and player::search_surroundings().
| void Character::add_miss_reason | ( | const std::string & | reason, |
| unsigned int | weight | ||
| ) |
Adds a reason for why the player would miss a melee attack.
To possibly be messaged to the player when he misses a melee attack.
| reason | A message for the player that gives a reason for him missing. |
| weight | The weight used when choosing what reason to pick when the player misses. |
Definition at line 318 of file melee.cpp.
References melee_miss_reasons.
Referenced by temperature_effect::apply(), eff_fun_hallu(), get_miss_reason(), player::hardcoded_effects(), player::process_one_effect(), player::reset_stats(), and suffer_in_sunlight().
| void Character::add_morale | ( | const morale_type & | type, |
| int | bonus, | ||
| int | max_bonus = 0, |
||
| const time_duration & | duration = 1_hours, |
||
| const time_duration & | decay_start = 30_minutes, |
||
| bool | capped = false, |
||
| const itype * | item_type = nullptr |
||
| ) |
Definition at line 9091 of file character.cpp.
Referenced by addict_effect(), apply_persistent_morale(), apply_wetness_morale(), iuse::artifact(), iuse::bell(), iuse::blech(), debug_menu::character_edit_menu(), iuse::datura(), monster::die(), avatar::do_read(), iuse::einktabletpc(), npc::finish_read(), player::fire_gun(), activity_handlers::generic_game_do_turn(), activity_handlers::haircut_finish(), marloss_add(), marloss_common(), activity_handlers::meditate_finish(), modify_morale(), spell_effect::morale(), iuse::mycus(), iuse::plantblech(), iuse::play_music(), activity_handlers::play_with_pet_finish(), iuse::portable_game(), game::process_artifact(), process_bionic(), firestarter_actor::resolve_firestarter_use(), set_up_butchery_activity(), activity_handlers::shaving_finish(), game::start_game(), suffer_from_chemimbalance(), suffer_from_other_mutations(), suffer_from_schizophrenia(), suffer_while_awake(), activity_handlers::tree_communion_do_turn(), update_bodytemp(), enzlave_actor::use(), musical_instrument_actor::use(), mutagen_actor::use(), mutagen_iv_actor::use(), activity_handlers::vibe_do_turn(), activity_handlers::vibe_finish(), and avatar::vomit().
| int Character::addiction_level | ( | add_type | type | ) | const |
Returns the intensity of the specified addiction.
Definition at line 1958 of file suffer.cpp.
References addictions, and type.
Referenced by iuse::ecig(), mend(), player::process_one_effect(), and iuse::smoking().
| tripoint Character::adjacent_tile | ( | ) | const |
Returns an unoccupied, safe adjacent point.
If none exists, returns player position.
Definition at line 7842 of file character.cpp.
References map::field_at(), g, get_map(), trap::is_benign(), field_entry::is_dangerous(), trap::is_null(), map::passable(), map::points_in_radius(), pos(), random_entry(), cata::hash64_detail::ret, and map::tr_at().
Referenced by player::uncanny_dodge(), and vomit().
| int Character::adjust_for_focus | ( | int | amount | ) | const |
Definition at line 9928 of file character.cpp.
References bio_memory, focus_pool, get_int(), has_active_bionic(), has_trait(), roll_remainder(), trait_FASTLEARNER, and trait_SLOWLEARNER.
Referenced by spell::casting_exp(), avatar::do_read(), and player::practice().
| int Character::age | ( | ) | const |
Definition at line 6901 of file character.cpp.
References init_age, calendar::turn, calendar::turn_zero, and calendar::year_length().
Referenced by age_string(), player_morale::morale_point::deserialize(), submap::load(), player_morale::morale_point::serialize(), and set_base_age().
| std::string Character::age_string | ( | ) | const |
Definition at line 6908 of file character.cpp.
References _, age(), and string_format().
Referenced by draw_stats_info(), and draw_stats_tab().
| double Character::aim_cap_from_volume | ( | const item & | gun | ) | const |
Definition at line 644 of file character.cpp.
References item::gun_skill(), skill_archery, skill_pistol, skill_rifle, skill_shotgun, skill_smg, and item::volume().
Referenced by aim_per_move().
| double Character::aim_per_move | ( | const item & | gun, |
| double | recoil | ||
| ) | const |
Definition at line 665 of file character.cpp.
References aim_cap_from_volume(), aim_speed_dex_modifier(), aim_speed_encumbrance_modifier(), aim_speed_skill_modifier(), get_fastest_sight(), item::gun_skill(), item::is_gun(), logarithmic_range(), MAX_RECOIL, and recoil.
Referenced by npc::aim(), do_aim(), player::gun_engagement_moves(), npc::method_of_attack(), and target_ui::panel_fire_mode_aim().
| double Character::aim_speed_dex_modifier | ( | ) | const |
| double Character::aim_speed_encumbrance_modifier | ( | ) | const |
Definition at line 639 of file character.cpp.
References bp_hand_l, bp_hand_r, and encumb().
Referenced by aim_per_move(), and get_encumbrance_description().
| double Character::aim_speed_skill_modifier | ( | const skill_id & | gun_skill | ) | const |
Definition at line 618 of file character.cpp.
References get_skill_level(), MAX_SKILL, skill_pistol, and skill_rifle.
Referenced by aim_per_move().
| std::vector< const item * > Character::all_items_with_flag | ( | const std::string & | flag | ) | const |
All items that have the given flag (item::has_flag).
Definition at line 9591 of file character.cpp.
References item::has_flag(), and visitable< Character >::items_with().
Referenced by iexamine::choose_fertilizer(), iexamine::dimensional_portal(), has_fire(), and use_fire().
| morale_type Character::allergy_type | ( | const item & | food | ) | const |
Returns allergy type or MORALE_NULL if not allergic for this character.
Definition at line 612 of file consumption.cpp.
References flag_ALLERGEN_FRUIT(), flag_ALLERGEN_JUNK(), flag_ALLERGEN_MEAT(), flag_ALLERGEN_MILK(), flag_ALLERGEN_VEGGY(), flag_ALLERGEN_WHEAT(), item::has_flag(), has_trait(), MORALE_ANTIFRUIT, MORALE_ANTIJUNK, MORALE_ANTIWHEAT, MORALE_LACTOSE, MORALE_MEATARIAN, MORALE_NULL, MORALE_VEGETARIAN, trait_ANTIFRUIT, trait_ANTIJUNK, trait_ANTIWHEAT, trait_LACTOSE, trait_MEATARIAN, and trait_VEGETARIAN.
Referenced by item::color_in_inventory(), modify_morale(), and will_eat().
| invlets_bitset Character::allocated_invlets | ( | ) | const |
Only use for UI things.
Returns all invlets that are currently used in the player inventory, the weapon slot and the worn items.
Definition at line 2547 of file character.cpp.
References inventory::allocated_invlets(), inv, item::invlet, weapon, and worn.
Referenced by inventory::assign_empty_invlet(), game_menus::inv::common(), and i_add().
| int Character::ammo_count_for | ( | const item & | gun | ) |
Counts ammo and UPS charges (lower of) for a given gun on the character.
Definition at line 6515 of file character.cpp.
References item::ammo_remaining(), item::ammo_required(), visitable< Character >::charges_of(), find_ammo(), item::get_gun_ups_drain(), item::INFINITE_CHARGES, item::is_gun(), itype_UPS, item::magazine_integral(), and cata::hash64_detail::ret.
Referenced by give_item_to().
| std::pair< int, int > Character::amount_of_storage_bionics | ( | ) | const |
Returns amount of Storage CBMs in the corpse.
Definition at line 2619 of file bionics.cpp.
References bio_power_storage, bio_power_storage_mkII, bionic_data::capacity, get_max_power_level(), my_bionics, and one_in().
Referenced by place_corpse().
| int Character::amount_worn | ( | const itype_id & | id | ) | const |
Returns the amount of item ‘type’ that is currently worn.
Definition at line 2241 of file character.cpp.
References worn.
Referenced by can_wear().
|
overridevirtual |
Actually hurt the player, hurts a body_part directly, no armor reduction.
Implements Creature.
Definition at line 8407 of file character.cpp.
References _, Creature::add_msg_if_player(), Creature::as_player(), can_unwield(), player::can_wield(), character_takes_damage, debugmsg, item::display_name(), effect_bandaged, effect_disinfected, effect_mending, Creature::get_effect(), get_event_bus(), effect::get_max_duration(), get_painkiller(), Creature::get_part_hp_cur(), getID(), Creature::has_effect(), has_trait(), i_rem(), Creature::is_dead_state(), item::is_null(), effect::mod_duration(), Creature::mod_pain(), Creature::mod_part_hp_cur(), on_hurt(), put_into_vehicle_or_drop(), reduce_healing_effect(), roll_remainder(), event_bus::send(), trait_DEBUG_NODMG, tumbling, and weapon.
Referenced by activate_bionic(), iuse::blech(), cough(), debug_menu::debug(), do_damage_for_bionic_failure(), eff_fun_bleed(), eff_fun_fungus(), iuse::ehandcuffs(), game::find_or_make_stairs(), heal_actor::finish_using(), iexamine::flower_cactus(), iexamine::flower_poppy(), start_location::handle_heli_crash(), player::hardcoded_effects(), player::knock_back_to(), activity_handlers::operation_do_turn(), player::process_one_effect(), suffer_from_radiation(), suffer_from_sunburn(), suffer_water_damage(), and suffer_while_underwater().
|
protected |
Applies stat mods to character.
Definition at line 206 of file mutation.cpp.
References dex_max, get_mod(), int_max, per_max, recalc_hp(), and str_max.
Referenced by deactivate_mutation(), mutation_effect(), mutation_loss_effect(), mutation_spend_resources(), and suffer_mutation_power().
| void Character::apply_persistent_morale | ( | ) |
Ensures persistent morale effects are up-to-date.
Definition at line 9006 of file character.cpp.
References add_morale(), effect_took_prozac, effect_took_xanax, global_omt_location(), Creature::has_effect(), has_trait(), is_wearing(), itype_id, lerp_clamped(), MORALE_PERM_FPMODE_ON, MORALE_PERM_HOARDER, MORALE_PERM_NOFACE, MORALE_PERM_NOMAD, overmap_time, points_in_radius(), pos(), rem_morale(), rl_dist(), trait_HOARDER, trait_NOMAD, trait_NOMAD2, trait_NOMAD3, trait_PROF_FOODP, volume_capacity(), volume_carried(), and tripoint::xy().
Referenced by debug_menu::character_edit_menu(), check_and_recover_morale(), avatar::create(), and update_morale().
|
private |
Applies skill-based boosts to stats.
Definition at line 3501 of file character.cpp.
References dex_max, skill_boost::get_all(), get_skill_level(), Creature::get_value(), int_max, mod_stat(), per_max, recalc_hp(), Creature::remove_value(), skill_id, and str_max.
Referenced by reset_stats().
| void Character::apply_wetness_morale | ( | int | temperature | ) |
Recalculates morale penalty/bonus from wetness based on mutations, equipment and temperature.
Definition at line 1804 of file suffer.cpp.
References add_morale(), all_body_parts, body_wetness, BODYTEMP_COLD, BODYTEMP_HOT, exclusive_flag_coverage(), units::fabs(), MORALE_WET, mut_drench, temp_cur, WT_GOOD, WT_IGNORED, and WT_NEUTRAL.
Referenced by game::do_turn().
| bool Character::armor_absorb | ( | damage_unit & | du, |
| item & | armor | ||
| ) |
Reduces and mutates du, prints messages about armor taking damage.
Definition at line 8294 of file character.cpp.
References _, scrollingcombattext::add(), Creature::add_msg_if_player(), damage_unit::amount, material_type::bash_dmg_verb(), body_part_set::count(), material_type::cut_dmg_verb(), item::damage_level(), item::damage_resist(), itype::damage_scale, material_type::dmg_adj(), DT_BASH, flag_STURDY(), item::get_base_material(), item::get_coverage(), item::get_covered_body_parts(), item::get_random_material(), item::has_flag(), Creature::is_player(), m_bad, m_info, m_neutral, item::mitigate_damage(), item::mod_damage(), NORTH, one_in(), posx(), posy(), remove_color_tags(), rng(), SCT, item::tname(), and damage_unit::type.
Referenced by absorb_hit().
| double Character::armwear_factor | ( | ) | const |
Same as footwear factor, but for arms.
Definition at line 8923 of file character.cpp.
References cata::hash64_detail::ret, and wearing_something_on().
Referenced by suffer_in_sunlight().
|
inlineoverridevirtual |
Reimplemented from Creature.
Definition at line 212 of file character.h.
|
inlineoverridevirtual |
Reimplemented from Creature.
Definition at line 209 of file character.h.
Referenced by doors::close_door(), and emit_radio_signal().
| void Character::assign_activity | ( | const activity_id & | type, |
| int | moves = calendar::INDEFINITELY_LONG, |
||
| int | index = -1, |
||
| int | pos = INT_MIN, |
||
| const std::string & | name = "" |
||
| ) |
Legacy activity assignment, does not work for any activites using the new activity_actor class and may cause issues with resuming.
TODO: delete this once migration of activites to the activity_actor system is complete
Definition at line 9189 of file character.cpp.
References assign_activity(), Creature::moves, name, pos(), and type.
Referenced by activate_mutation(), activity_on_turn_move_loot(), assign_activity(), iuse::burrow(), game::butcher(), butcher_corpse_activity(), butcher_submenu(), cast_spell(), iuse::chop_logs(), chop_plank_activity(), iuse::chop_tree(), chop_tree_activity(), iuse::clear_rubble(), complete_construction(), construction_activity(), iuse::craft(), iuse::cut_log_into_planks(), iuse::dig(), iuse::dig_channel(), crafting::disassemble_all(), overmap_ui::display(), talk_function::do_butcher(), talk_function::do_chop_plank(), talk_function::do_chop_trees(), talk_function::do_construction(), talk_function::do_farming(), talk_function::do_fishing(), talk_function::do_mining(), npc::do_pulp(), player_activity::do_turn(), talk_function::do_vehicle_deconstruct(), talk_function::do_vehicle_repair(), drop(), game::exam_vehicle(), iuse::fill_pit(), npc::find_job_to_perform(), talk_function::find_mount(), avatar_action::fire_ranged_bionic(), avatar_action::fire_ranged_mutation(), avatar_action::fire_wielded_weapon(), activity_handlers::fish_finish(), iuse::fishing_rod(), generic_multi_activity_check_requirement(), generic_multi_activity_do(), generic_multi_activity_handler(), talk_function::give_aid(), talk_function::give_all_aid(), player::gunmod_add(), iuse::hacksaw(), iuse::hairkit(), iuse::hammer(), iuse::hand_crank(), install_bionics(), vehicle::interact_with(), iuse::jackhammer(), loot(), iuse::makemound(), iuse::meditate(), iuse::mind_splicer(), mine_activity(), iuse::oxytorch(), iuse::pickaxe(), game::place_player(), iexamine::plant_seed(), iuse::play_game(), avatar_action::plthrow(), iuse::portable_game(), prompt_disassemble_single(), avatar::read(), avatar_action::reload(), activity_handlers::resume_for_multi_activities(), iuse::robotcontrol(), iexamine::rubble(), iexamine::safe(), iuse::shavekit(), iexamine::shrub_wildveggies(), smash(), talk_function::sort_loot(), player::start_craft(), start_destination_activity(), game::start_hauling(), npc::start_read(), gates::toggle_gate(), player::toolmod_add(), iexamine::trap(), try_start_hacking(), player::try_to_sleep(), uninstall_bionic(), pick_lock_actor::use(), firestarter_actor::use(), enzlave_actor::use(), ammobelt_actor::use(), repair_item_actor::use(), heal_actor::use(), learn_spell_actor::use(), cast_spell_actor::use(), vehicle_activity(), iuse::vibe(), wait(), and wash_items().
| void Character::assign_activity | ( | const player_activity & | act, |
| bool | allow_resume = true |
||
| ) |
Assigns activity to player, possibly resuming old activity if it's similar enough.
Definition at line 9195 of file character.cpp.
References _, act, activity, Creature::add_msg_if_player(), backlog, cancel_stashed_activity(), npc::current_activity_id, player_activity::id(), Creature::is_npc(), NPC_MISSION_ACTIVITY, NPCATT_ACTIVITY, npc::set_attitude(), npc::set_mission(), and player_activity::start_or_resume().
| void Character::assign_stashed_activity | ( | ) |
Definition at line 989 of file character.cpp.
References activity, backlog, cancel_stashed_activity(), stashed_outbounds_activity, and stashed_outbounds_backlog.
Referenced by npc::move().
| int Character::attack_cost | ( | const item & | weap | ) | const |
Returns cost (in moves) of attacking with given item (no modifiers, like stuck)
Melee increases melee attack speed Dexterity increases attack speedDefinition at line 2216 of file melee.cpp.
References item::attack_cost(), enchant_vals::ATTACK_COST, bio_cqb, BIO_CQB_LEVEL, bionic_id, bonus_from_enchantments(), bp_hand_l, bp_hand_r, bp_torso, dex_cur, encumb(), get_skill_level(), get_stamina(), get_stamina_max(), has_active_bionic(), mabuff_attack_cost_mult(), mabuff_attack_cost_penalty(), move_cost(), mutation_value(), and skill_melee.
Referenced by player::disarm(), item::effective_dps(), melee_attack(), and player::reach_attack().
|
overridevirtual |
Attitude (of this creature) towards another creature.
This might not be symmetric.
Implements Creature.
Reimplemented in npc.
Definition at line 10366 of file character.cpp.
References Creature::A_FRIENDLY, Creature::A_HOSTILE, Creature::A_NEUTRAL, MATT_ATTACK, MATT_FLEE, MATT_FOLLOW, MATT_FPASSIVE, MATT_FRIEND, MATT_IGNORE, MATT_NULL, MATT_ZLAVE, NUM_MONSTER_ATTITUDES, and other.
Referenced by game::is_hostile_within(), and player::sort_armor().
| int Character::base_age | ( | ) | const |
Definition at line 6886 of file character.cpp.
References init_age.
Referenced by debug_menu::character_edit_menu(), char_creation::draw_age(), and set_description().
| Character::comfort_response_t Character::base_comfort_value | ( | const tripoint & | p | ) | const |
Rate point's ability to serve as a bed.
Only takes certain mutations into account, and not fatigue nor stimulants.
Definition at line 5687 of file character.cpp.
References Character::comfort_response_t::aid, trapfunc::board(), furn_t::comfort, trap::comfort, comfortable, f_null, fd_web, flag_FUNGUS(), flag_SWIMMABLE(), map::get_field_intensity(), maptile::get_furn(), get_map(), maptile::get_ter(), maptile::get_trap_t(), has_active_mutation(), map::has_flag_ter(), map::has_flag_ter_or_furn(), has_trait(), map::i_at(), impossible, trap::is_null(), Character::comfort_response_t::level, map::maptile_at(), map::move_cost(), neutral, int_id< T >::obj(), optional_vpart_position::part_with_feature(), pos(), slightly_comfortable, t_carpet_green, t_carpet_purple, t_carpet_red, t_carpet_yellow, t_dirt, t_dirtmound, t_floor, t_floor_waxed, t_grass, t_improvised_shelter, t_pit, t_pit_shallow, trait_CHLOROMORPH, trait_M_SKIN3, trait_SHELL2, trait_THRESH_SPIDER, trait_WATERSLEEP, trait_WEB_SPINNER, trait_WEB_WALKER, trait_WEB_WEAVER, uncomfortable, map::veh_at(), and very_comfortable.
Referenced by player::sleep_spot(), and update_needs().
| int Character::base_height | ( | ) | const |
Definition at line 6915 of file character.cpp.
References init_height.
Referenced by debug_menu::character_edit_menu(), char_creation::draw_height(), and set_description().
| int Character::best_nearby_lifting_assist | ( | ) | const |
Checks for items, tools, and vehicles with the Lifting quality near the character returning the highest quality in range.
Definition at line 2729 of file character.cpp.
References best_nearby_lifting_assist(), and pos().
Referenced by best_nearby_lifting_assist(), can_do_activity_there(), and weight_carried_reduced_by().
| int Character::best_nearby_lifting_assist | ( | const tripoint & | world_pos | ) | const |
Alternate version if you need to specify a different orign point for nearby vehicle sources of lifting used for operations on distant objects (e.g.
vehicle installation/uninstallation)
Definition at line 2734 of file character.cpp.
References is_mounted(), visitable< T >::max_quality(), visitable< Character >::max_quality(), MF_RIDEABLE_MECH, mounted_creature, PICKUP_RANGE, and pos().
| item * Character::best_quality_item | ( | const quality_id & | qual | ) |
get best quality item that this character has
Definition at line 4719 of file character.cpp.
References visitable< T >::has_quality(), visitable< Character >::items_with(), and random_entry().
Referenced by chop_plank_activity(), chop_tree_activity(), and generic_multi_activity_do().
| item & Character::best_shield | ( | ) |
Returns the best item for blocking with.
Definition at line 1544 of file melee.cpp.
References blocking_ability(), bp_arm_l, bp_arm_r, bp_leg_l, bp_leg_r, get_working_leg_count(), is_limb_disabled(), null_item_reference(), weapon, and worn.
Referenced by block_hit().
| float Character::bionic_armor_bonus | ( | const bodypart_id & | bp, |
| damage_type | dt | ||
| ) | const |
Check for passive bionics that provide armor, and returns the armor bonus This is called from player::passive_absorb_hit.
Definition at line 8357 of file character.cpp.
References bionic_data::bash_protec, bionic_data::bullet_protec, bionic_data::cut_protec, DT_BASH, DT_BULLET, DT_CUT, DT_STAB, get_bionics(), and int_id< T >::id().
Referenced by passive_absorb_hit().
| bionic & Character::bionic_at_index | ( | int | i | ) |
Returns the bionic at a given index in my_bionics[].
Definition at line 2652 of file bionics.cpp.
References my_bionics.
Referenced by absorb_hit(), and sleep().
| std::map< bodypart_id, int > Character::bionic_installation_issues | ( | const bionic_id & | bioid | ) | const |
Definition at line 2498 of file bionics.cpp.
References get_free_bionics_slots(), and bionic_data::occupied_bodyparts.
Referenced by can_install_bionics(), and item::color_in_inventory().
| float Character::bionics_adjusted_skill | ( | const skill_id & | most_important_skill, |
| const skill_id & | important_skill, | ||
| const skill_id & | least_important_skill, | ||
| int | skill_level = -1 |
||
| ) |
Calculate skill for (un)installing bionics.
Definition at line 1843 of file bionics.cpp.
References bionics_pl_skill(), effect_assisted, env_surgery_bonus(), and Creature::get_effect_int().
Referenced by best_installer(), can_install_bionics(), can_uninstall_bionic(), bionic_install_preset::get_failure_chance(), bionic_install_surgeon_preset::get_failure_chance(), bionic_uninstall_preset::get_failure_chance(), install_bionics(), game::save_cyborg(), and uninstall_bionic().
| void Character::bionics_install_failure | ( | const std::string & | installer, |
| int | difficulty, | ||
| int | success, | ||
| float | adjusted_skill | ||
| ) |
Definition at line 2391 of file bionics.cpp.
References _, add_bionic(), add_msg(), disp_name(), do_damage_for_bionic_failure(), anonymous_namespace{bionics.cpp}::faulty_bionics, units::from_kilojoule(), g, get_max_power_level(), getID(), has_bionic(), has_max_power(), id, installs_faulty_cbm, Creature::is_player(), m_bad, m_neutral, name, pgettext(), random_entry(), rng(), set_max_power_level(), behavior::success, and units::to_kilojoule().
Referenced by perform_install().
| int Character::bionics_pl_skill | ( | const skill_id & | most_important_skill, |
| const skill_id & | important_skill, | ||
| const skill_id & | least_important_skill, | ||
| int | skill_level = -1 |
||
| ) |
Calculate non adjusted skill for (un)installing bionics.
Definition at line 1858 of file bionics.cpp.
References get_skill_level(), has_trait(), int_cur, trait_PROF_AUTODOC, and trait_PROF_MED.
Referenced by bionics_adjusted_skill(), install_bionics(), and uninstall_bionic().
| void Character::bionics_uninstall_failure | ( | int | difficulty, |
| int | success, | ||
| float | adjusted_skill | ||
| ) |
When a player fails the surgery.
Definition at line 1734 of file bionics.cpp.
References _, add_msg(), do_damage_for_bionic_failure(), m_neutral, and behavior::success.
Referenced by perform_uninstall(), and uninstall_bionic().
| void Character::bionics_uninstall_failure | ( | monster & | installer, |
| player & | patient, | ||
| int | difficulty, | ||
| int | success, | ||
| float | adjusted_skill | ||
| ) |
When a monster fails the surgery.
Definition at line 1769 of file bionics.cpp.
References _, add_msg(), do_damage_for_bionic_failure(), player::is_player(), m_mixed, m_neutral, monster::name(), rng(), sees(), and behavior::success.
| units::mass Character::bionics_weight | ( | ) | const |
Definition at line 6869 of file character.cpp.
References get_bionics().
Referenced by get_weight().
|
overridevirtual |
Checks for valid block abilities and reduces damage accordingly.
Returns true if the player blocks
Strength increases attack blocking effectiveness with a limb or worn/wielded item Unarmed increases attack blocking effectiveness with a limb or worn/wielded itemImplements Creature.
Definition at line 1574 of file melee.cpp.
References _, add_msg(), Creature::add_msg_player_or_npc(), best_shield(), Creature::block_bonus, blocking_ability(), blocks_left, body_part_name(), item::conductive(), item::covers(), damage_instance::damage_units, DT_ACID, DT_BASH, DT_COLD, DT_CUT, DT_ELECTRIC, DT_HEAT, DT_STAB, effect_narcosis, Creature::get_part_hp_cur(), get_skill_level(), get_stamina(), get_stamina_max(), handle_melee_wear(), Creature::has_effect(), item::has_flag(), in_sleep_state(), Creature::is_dead_state(), Creature::is_hallucination(), item::is_null(), logarithmic_range(), m_bad, mabuff_block_bonus(), item::made_of(), martial_arts_data, melee_attack(), one_in(), pgettext(), pick_technique(), skill_melee, skill_unarmed, str_cur, tec_none, item::tname(), and weapon.
| int Character::blood_loss | ( | const bodypart_id & | bp | ) | const |
Define blood loss (in percents)
Definition at line 5818 of file character.cpp.
References Creature::get_part_hp_cur(), and Creature::get_part_hp_max().
|
overridevirtual |
Implements Creature.
Definition at line 482 of file character.cpp.
References fd_acid, fd_blood, fd_blood_insect, fd_blood_invertebrate, fd_blood_veggy, has_trait(), trait_ACIDBLOOD, trait_THRESH_CEPHALOPOD, trait_THRESH_INSECT, trait_THRESH_PLANT, and trait_THRESH_SPIDER.
| void Character::blossoms | ( | ) |
Definition at line 8790 of file character.cpp.
References _, map::add_field(), sounds::combat, fd_fungal_haze, get_map(), map::points_in_radius(), pos(), rng(), and sounds::sound().
Referenced by activate_mutation(), and suffer_while_awake().
| float Character::bmi | ( | ) | const |
Definition at line 6859 of file character.cpp.
Referenced by bodyweight(), debug_menu::debug(), character_display::disp_info(), and suffer_mutation_power().
| int Character::bmr | ( | ) | const |
Definition at line 6966 of file character.cpp.
References metabolic_rate_base().
Referenced by debug_menu::debug(), fall_asleep(), get_hunger_description(), and update_stomach().
| hp_part Character::body_window | ( | const std::string & | menu_header, |
| bool | show_all, | ||
| bool | precise, | ||
| int | normal_bonus, | ||
| int | head_bonus, | ||
| int | torso_bonus, | ||
| float | bleed, | ||
| float | bite, | ||
| float | infect, | ||
| float | bandage_power, | ||
| float | disinfectant_power | ||
| ) | const |
Displays menu with body part hp, optionally with hp estimation after healing.
Returns selected part. menu_header - name of item that triggers this menu show_all - show and enable choice of all limbs, not only healable precise - show numerical hp normal_bonus - heal normal limb head_bonus - heal head torso_bonus - heal torso bleed - chance to stop bleeding bite - chance to remove bite infect - chance to remove infection bandage_power - quality of bandage disinfectant_power - quality of disinfectant
Definition at line 5848 of file character.cpp.
References _, uilist::addentry(), uilist::addentry_desc(), Creature::bleed(), c_blue, c_green, c_light_gray, c_light_green, c_red, c_white, c_yellow, colorize(), uilist::desc_enabled, effect_bandaged, effect_bite, effect_bleed, effect_disinfected, effect_infected, effect_mending, flag_SPLINT(), Creature::get_effect(), Creature::get_effect_int(), get_hp_bar(), effect::get_max_intensity(), Creature::get_part_hp_cur(), Creature::get_part_hp_max(), Creature::has_effect(), uilist::hilight_disabled, hp_arm_l, hp_arm_r, hp_head, hp_leg_l, hp_leg_r, hp_torso, uilist::init(), is_limb_broken(), limb_color(), MENU_AUTOASSIGN, name, num, num_hp_parts, uilist::query(), uilist::ret, string_format(), texitify_healing_power(), uilist::text, utf8_width(), and worn_with_flag().
Referenced by game::npc_menu(), and pick_part_to_heal().
| std::map< bodypart_id, float > Character::bodypart_exposure | ( | ) |
Map body parts to their total exposure, from 0.0 (fully covered) to 1.0 (buck naked).
Clothing layers are multiplied, ex. two layers of 50% coverage will leave only 25% exposed. Used to determine suffering effects of albinism and solar sensitivity.
Definition at line 782 of file suffer.cpp.
References all_body_parts, Creature::get_all_body_parts(), num_bp, body_part_set::test(), and worn.
Referenced by suffer_from_sunburn().
| nc_color Character::bodytemp_color | ( | int | bp | ) | const |
Define color for displaying the body temperature.
Definition at line 10439 of file character.cpp.
References BODYTEMP_COLD, BODYTEMP_FREEZING, BODYTEMP_HOT, BODYTEMP_SCORCHING, BODYTEMP_VERY_COLD, BODYTEMP_VERY_HOT, bp_eyes, c_blue, c_cyan, c_green, c_light_blue, c_light_gray, c_light_red, c_red, c_yellow, color(), and temp_conv.
Referenced by character_display::print_encumbrance().
| int Character::bodytemp_modifier_traits | ( | bool | overheated | ) | const |
Correction factor of the body temperature due to traits and mutations.
Definition at line 9541 of file character.cpp.
References get_mutations().
Referenced by update_bodytemp().
| int Character::bodytemp_modifier_traits_floor | ( | ) | const |
Correction factor of the body temperature due to traits and mutations for player lying on the floor.
Definition at line 9550 of file character.cpp.
References get_mutations().
Referenced by floor_warmth().
| units::mass Character::bodyweight | ( | ) | const |
Definition at line 6864 of file character.cpp.
References bmi(), units::from_kilogram(), and height().
Referenced by get_weight(), and get_weight_string().
| float Character::bonus_damage | ( | bool | random | ) | const |
Returns the bonus bashing damage the player deals based on their stats.
Strength increases bashing damageDefinition at line 860 of file melee.cpp.
References get_str(), om_direction::random(), and rng_float().
Referenced by draw_stats_info(), roll_bash_damage(), and set_stats().
| double Character::bonus_from_enchantments | ( | double | base, |
| enchant_vals::mod | value, | ||
| bool | round = false |
||
| ) | const |
Calculate bonus from enchantments for given base value.
Definition at line 8038 of file character.cpp.
References enchantment_cache.
Referenced by armor_enchantment_adjust(), attack_cost(), known_magic::mana_regen_rate(), known_magic::max_mana(), metabolic_rate_base(), and run_cost().
Converts a body_part to an hp_part.
Definition at line 6563 of file character.cpp.
References bp_arm_l, bp_arm_r, bp_eyes, bp_foot_l, bp_foot_r, bp_hand_l, bp_hand_r, bp_head, bp_leg_l, bp_leg_r, bp_mouth, bp_torso, hp_arm_l, hp_arm_r, hp_head, hp_leg_l, hp_leg_r, hp_torso, and num_hp_parts.
Referenced by iexamine::autodoc(), explosion_handler::shrapnel(), and heal_actor::use_healing_item().
| void Character::build_mut_dependency_map | ( | const trait_id & | mut, |
| std::unordered_map< trait_id, int > & | dependency_map, | ||
| int | distance | ||
| ) |
Recursively traverses the mutation's prerequisites and replacements, building up a map.
Definition at line 7901 of file character.cpp.
References build_mut_dependency_map(), has_base_trait(), string_id< T >::obj(), mutation_branch::prereqs, mutation_branch::prereqs2, mutation_branch::replacements, and second.
Referenced by build_mut_dependency_map(), and set_highest_cat_level().
| bool Character::burn_fuel | ( | int | b, |
| bool | start = false |
||
| ) |
Convert fuel to bionic power.
Definition at line 1154 of file bionics.cpp.
References _, Creature::add_msg_player_or_npc(), b, consume_remote_fuel(), current_weather(), deactivate_bionic(), default_daylight_level(), map::emit_field(), find_remote_fuel(), flag_PERPETUAL(), flag_SAFE_FUEL_OFF(), units::from_kilojoule(), bionic_data::fuel_efficiency, item::fuel_energy(), bionic_data::fuel_opts, fuel_type_metabolism, fuel_type_muscle, fuel_type_sun_light, fuel_type_wind, g, get_effective_efficiency(), get_fuel_available(), get_local_windpower(), get_map(), get_max_power_level(), get_power_level(), get_stored_kcal(), Creature::get_value(), get_weather(), global_omt_location(), bionic::has_flag(), item::has_flag(), heat_emission(), bionic::id, incident_sunlight(), bionic::info(), bionic::is_auto_start_keep_full(), string_id< T >::is_empty(), bionic_data::is_remote_fueled, bionic::is_this_fuel_powered(), item_worn_with_flag(), m_bad, m_info, max_stored_kcal(), mod_power_level(), mod_stored_kcal(), bionic_data::name, overmap_buffer, pos(), bionic_data::power_gen_emission, bionic::powered, Creature::remove_value(), Creature::set_value(), itype::solar_efficiency, overmapbuffer::ter(), to_string(), calendar::turn, item::type, update_fuel_storage(), map::veh_at(), weather_manager::winddirection, and weather_manager::windspeed.
Referenced by activate_bionic(), and process_bionic().
| void Character::burn_move_stamina | ( | int | moves | ) |
Definition at line 7223 of file character.cpp.
References _, add_msg(), Creature::add_msg_if_player(), CMM_RUN, get_bionic_fueled_with(), Creature::get_pain(), get_stamina(), has_active_bionic(), has_trait(), m_bad, m_debug, Creature::mod_pain(), mod_stamina(), move_mode, Creature::moves, one_in(), stamina_move_cost_modifier(), trait_BADBACK, weight_capacity(), and weight_carried().
Referenced by avatar_action::swim(), and game::walk_move().
| void Character::calc_all_parts_hp | ( | float | hp_mod = 0.0, |
| float | hp_adjust = 0.0, |
||
| int | str_max = 0 |
||
| ) |
Sets hp for all body parts.
Definition at line 1673 of file character.cpp.
References Creature::get_body(), bodypart::get_hp_cur(), bodypart::get_hp_max(), Creature::get_part(), has_trait(), bodypart::set_hp_cur(), bodypart::set_hp_max(), str_max, and trait_id.
Referenced by recalc_hp().
|
protected |
Recalculate encumbrance for all body parts.
Definition at line 3648 of file character.cpp.
References calc_encumbrance().
Referenced by calc_encumbrance(), get_encumbrance(), on_item_takeoff(), on_item_wear(), and reset_encumbrance().
|
protected |
Recalculate encumbrance for all body parts as if new_item was also worn.
Definition at line 3653 of file character.cpp.
References item_encumb(), and mut_cbm_encumb().
| needs_rates Character::calc_needs_rates | ( | ) | const |
Definition at line 4893 of file character.cpp.
References ACT_TREE_COMMUNION, Creature::add_msg_if_player(), bio_recycler, effect_sleep, needs_rates::fatigue, Creature::get_effect(), Creature::get_perceived_pain(), weather_manager::get_temperature(), get_weather(), has_activity(), has_bionic(), has_trait(), needs_rates::hunger, is_hibernating(), Creature::is_npc(), m_debug, metabolic_rate(), mutation_value(), pos(), needs_rates::recovery, sleep(), needs_rates::thirst, trait_ROOTS2, trait_ROOTS3, trait_TRANSPIRATION, and worn_with_flag().
Referenced by update_needs(), and update_stomach().
| bool Character::can_consume | ( | const item & | it | ) | const |
Check character's capability of consumption overall.
Definition at line 1492 of file consumption.cpp.
References can_consume_as_is(), item::contents, flag_NO_RELOAD(), item_contents::front(), item::has_flag(), and item::is_container_empty().
Referenced by find_auto_consume(), and examine_item_menu::rate_action_eat().
| bool Character::can_consume_as_is | ( | const item & | it | ) | const |
Check whether character can consume this very item.
Definition at line 1482 of file consumption.cpp.
References can_consume_for_bionic(), and item::is_comestible().
Referenced by can_consume(), player::consume(), avatar_action::eat(), and get_consumable_from().
| bool Character::can_consume_for_bionic | ( | const item & | it | ) | const |
Definition at line 1487 of file consumption.cpp.
References get_cbm_rechargeable_with(), and none.
Referenced by can_consume_as_is().
| ret_val< edible_rating > Character::can_eat | ( | const item & | food | ) | const |
Can the food be [theoretically] eaten no matter the consequen ces?
Definition at line 635 of file consumption.cpp.
References _, carnivore_blacklist, comesttype_DRINK(), comesttype_FOOD(), compute_effective_nutrients(), item::count_by_charges(), edible, flag_BIRD(), flag_CARNIVORE_OK(), flag_CATTLE(), flag_FELINE(), flag_INEDIBLE(), flag_LUPINE(), flag_MYCUS_OK(), flag_NO_INGEST(), flag_USE_EAT_VERB(), item::get_comestible(), get_mutations(), visitable< Character >::has_amount(), item::has_any_flag(), has_charges(), item::has_flag(), item::has_own_flag(), has_trait(), herbivore_blacklist(), inedible_mutation, item::is_craft(), item::is_medication(), item::is_null(), Creature::is_underwater(), item::made_of_any(), ret_val< T >::make_failure(), ret_val< T >::make_success(), itype::materials, item::nname(), no_tool, string_format(), trait_CARNIVORE, trait_HERBIVORE, trait_M_DEPENDENT, trait_PROBOSCIS, trait_RUMINANT, trait_THRESH_BIRD, trait_THRESH_CATTLE, trait_THRESH_FELINE, trait_THRESH_LUPINE, trait_WATERSLEEP, and item::type.
Referenced by can_feed_furnace_with(), can_feed_reactor_with(), player::eat(), and will_eat().
| bool Character::can_estimate_rot | ( | ) | const |
True if the character has enough skill (in cooking or survival) to estimate time to rot.
Definition at line 1477 of file consumption.cpp.
References get_skill_level(), skill_cooking, and skill_survival.
| bool Character::can_feed_furnace_with | ( | const item & | it | ) | const |
Definition at line 1301 of file consumption.cpp.
References bio_furnace, can_eat(), item::charges_per_volume(), flag_CORPSE(), flag_RADIOACTIVE(), item::flammable(), furnace_max_volume, has_active_bionic(), item::has_flag(), and behavior::success.
Referenced by feed_furnace_with(), and get_cbm_rechargeable_with().
| bool Character::can_feed_reactor_with | ( | const item & | it | ) | const |
Determine character's capability of recharging their CBMs.
Definition at line 1254 of file consumption.cpp.
References bio_advreactor, bio_reactor, can_eat(), has_active_bionic(), item::is_ammo(), and behavior::success.
Referenced by feed_reactor_with(), and get_cbm_rechargeable_with().
| bool Character::can_fuel_bionic_with | ( | const item & | it | ) | const |
Returns true if the character can fuel a bionic with the item.
Definition at line 1912 of file character.cpp.
References get_bionics(), item::is_fuel(), and item::typeId().
Referenced by fuel_bionic_with(), and get_cbm_rechargeable_with().
| bool Character::can_hear | ( | const tripoint & | source, |
| int | volume | ||
| ) | const |
Definition at line 10258 of file character.cpp.
References get_weather(), hearing_ability(), is_deaf(), pos(), and rl_dist().
Referenced by game::chat(), iuse::geiger(), iuse::play_music(), iuse::talking_doll(), and musical_instrument_actor::use().
| bool Character::can_install_bionics | ( | const itype & | type, |
| player & | installer, | ||
| bool | autodoc = false, |
||
| int | skill_level = -1 |
||
| ) |
Is the installation possible.
Definition at line 2149 of file bionics.cpp.
References _, iexamine::autodoc(), bionic_installation_issues(), bionic_manip_cos(), bionics_adjusted_skill(), body_part_name_as_heading(), bionic_data::canceled_mutations, debugmsg, enumerate_as_string(), g, has_trait(), is_mounted(), mutation_branch::name(), popup(), query_yn(), skill_computer, skill_electronics, skill_firstaid, skill_mechanics, string_format(), and type.
Referenced by iexamine::autodoc(), and install_bionic_actor::use().
| bool Character::can_install_cbm_on_bp | ( | const std::vector< bodypart_id > & | bps | ) | const |
Definition at line 456 of file mutation.cpp.
References get_mutations().
Referenced by bionic_install_preset::get_denial().
| bool Character::can_learn_by_disassembly | ( | const recipe & | rec | ) | const |
Definition at line 10586 of file character.cpp.
References recipe::learn_by_disassembly, and meets_skill_requirements().
Referenced by crafting::complete_disassemble().
| bool Character::can_miss_recovery | ( | const item & | weap | ) | const |
Returns true if the player is able to use a miss recovery technique.
Definition at line 948 of file martialarts.cpp.
References ma_technique::is_valid_character(), and martial_arts_data.
Referenced by melee_attack().
| bool Character::can_mount | ( | const monster & | critter | ) | const |
Definition at line 560 of file monexamine.cpp.
References effect_ai_waiting, effect_ridden, effect_saddled, monster::friendly, g, monster::get_mountable_weight_ratio(), get_path_avoid(), get_pathfinding_settings(), get_size(), monster::get_size(), get_skill_level(), get_weight(), monster::get_weight(), Creature::has_effect(), monster::has_flag(), MF_PET_MOUNTABLE, pos(), monster::pos(), and skill_survival.
Referenced by talk_function::find_mount(), and activity_handlers::find_mount_do_turn().
| bool Character::can_pick_volume | ( | const item & | it | ) | const |
Definition at line 2887 of file character.cpp.
References inventory::add_item(), inv, inventory::volume(), and volume_capacity().
Referenced by player::add_or_drop_with_msg(), pickup_inventory_preset::get_denial(), give_item_to(), handle_harvest(), handle_problematic_pickup(), i_add_or_drop(), npc::mug_player(), pick_one_up(), conditional_t< T >::set_can_stow_weapon(), set_item_inventory(), and starting_inv().
| bool Character::can_pick_volume | ( | units::volume | volume | ) | const |
Definition at line 2894 of file character.cpp.
References inv, inventory::volume(), and volume_capacity().
| bool Character::can_pick_weight | ( | const item & | it, |
| bool | safe = true |
||
| ) | const |
Definition at line 2901 of file character.cpp.
References can_pick_weight(), iexamine::safe(), and item::weight().
Referenced by player::add_or_drop_with_msg(), can_pick_weight(), pickup_inventory_preset::get_denial(), give_item_to(), handle_harvest(), i_add_or_drop(), npc::mug_player(), pick_one_up(), and set_item_inventory().
| bool Character::can_pick_weight | ( | units::mass | weight, |
| bool | safe = true |
||
| ) | const |
Definition at line 2906 of file character.cpp.
References has_trait(), units::mass_max, iexamine::safe(), trait_DEBUG_STORAGE, weight_capacity(), and weight_carried().
| bool Character::can_run | ( | ) |
source of truth of whether a Character can run
Definition at line 1329 of file character.cpp.
References get_stamina(), get_stamina_max(), and get_working_leg_count().
Referenced by game::on_move_effects(), and avatar::set_movement_mode().
Check player capable of swapping the side of a worn item.
| it | Thing to be swapped |
Definition at line 3164 of file character.cpp.
References _, BOTH, convert_bp(), flag_POWERARMOR_MOD(), item::get_covered_body_parts(), item::has_flag(), ret_val< T >::make_failure(), ret_val< T >::make_success(), num_bp, body_part_type::opposite_part, body_part_type::part_side, body_part_set::test(), body_part_type::token, and worn.
Referenced by change_side().
| bool Character::can_uninstall_bionic | ( | const bionic_id & | b_id, |
| player & | installer, | ||
| bool | autodoc = false, |
||
| int | skill_level = -1 |
||
| ) |
Is The uninstallation possible.
Definition at line 1907 of file bionics.cpp.
References _, iexamine::autodoc(), bio_advreactor, bio_eye_optic, bio_reactor, bionic_manip_cos(), BIONIC_NOITEM_DIFFICULTY, bionics_adjusted_skill(), disp_name(), g, get_bionics(), has_bionic(), string_id< T >::is_valid(), bionic_data::itype(), bionic_data::name, popup(), skill_computer, skill_electronics, skill_firstaid, skill_mechanics, and type.
Referenced by iexamine::autodoc().
Check player capable of unwielding an item.
| it | Thing to be unwielded |
Definition at line 3155 of file character.cpp.
References _, item::has_flag(), ret_val< T >::make_failure(), ret_val< T >::make_success(), and item::tname().
Referenced by apply_damage(), drop(), inv_dump(), examine_item_menu::run(), player::unwield(), and avatar_action::wield().
Checks if character stats and skills meet minimum requirements for the item.
Prints an appropriate message if requirements not met.
| it | Item we are checking |
| context | optionally override effective item when checking contextual skills |
Definition at line 2917 of file character.cpp.
References _, Creature::add_msg_player_or_npc(), enumerate_unmet_requirements(), item::is_null(), m_bad, meets_requirements(), and item::tname().
Referenced by can_use_heal_item(), player::gunmod_add(), ranged::gunmode_checks_common(), and player::toolmod_add().
| bool Character::can_use_floor_warmth | ( | ) | const |
Can the player lie down and cover self with blankets etc.
Definition at line 9440 of file character.cpp.
References has_activity(), and in_sleep_state().
Referenced by update_bodytemp().
| bool Character::can_use_heal_item | ( | const item & | med | ) | const |
Check for mutation disallowing the use of an healing item.
Definition at line 424 of file mutation.cpp.
References can_use(), get_mutations(), item::has_flag(), and item::typeId().
Referenced by activatable_inventory_preset::get_denial(), and heal_actor::use_healing_item().
Check character capable of wearing an item.
| it | Thing to be worn |
| with_equip_change | If true returns if it could be worn if things were taken off |
Definition at line 2942 of file character.cpp.
References _, amount_worn(), BOTH, bp_foot_l, bp_foot_r, bp_head, bp_torso, convert_bp(), item::covers(), flag_AURA(), flag_BELTED(), flag_HELMET_COMPAT(), flag_ONLY_ONE(), flag_OUTER(), flag_OVERSIZE(), flag_PERSONAL(), flag_POWERARMOR_COMPATIBLE(), flag_POWERARMOR_EXO(), flag_POWERARMOR_EXTERNAL(), flag_POWERARMOR_MOD(), flag_RESTRICT_HANDS(), flag_SEMITANGIBLE(), flag_SKINTIGHT(), flag_SPLINT(), Creature::get_all_body_parts(), item::get_covered_body_parts(), item::get_encumber(), get_mutations(), item::has_flag(), item::has_own_flag(), has_trait(), has_two_arms(), head_cloth_encumbrance(), item::is_armor(), item::is_filthy(), is_limb_broken(), Creature::is_player(), item::is_power_armor(), item::is_sided(), item::is_two_handed(), is_wearing_helmet(), is_wearing_power_armor(), is_wearing_shoes(), LEFT, item::made_of(), ret_val< T >::make_failure(), ret_val< T >::make_success(), MAX_WORN_PER_TYPE, name, num_bp, body_part_type::part_side, RIGHT, string_format(), body_part_set::test(), item::tname(), trait_ANTENNAE, trait_ANTLERS, trait_HORNS_POINTED, trait_SQUEAMISH, trait_WOOLALLERGY, item::type_name(), item::typeId(), weapon, wearing_something_on(), worn, and worn_with_flag().
Referenced by behavior::character_oracle_t::can_wear_warmer_clothes(), dispose_item(), wear_inventory_preset::get_denial(), give_item_to(), handle_problematic_pickup(), examine_item_menu::rate_action_wear(), starting_clothes(), player::use(), npc::wear_if_wanted(), and wear_item().
| void Character::cancel_activity | ( | ) |
Definition at line 9232 of file character.cpp.
References ACT_MOVE_ITEMS, ACT_TRY_SLEEP, ACT_WAIT_STAMINA, activity, backlog, player_activity::canceled(), sfx::end_activity_sounds(), has_activity(), is_hauling(), player_activity::is_suspendable(), Creature::remove_value(), and stop_hauling().
Referenced by activity_on_turn_move_loot(), activity_on_turn_wear(), activity_handlers::adv_inventory_do_turn(), activity_handlers::armor_layers_do_turn(), activity_handlers::build_do_turn(), player::can_continue_craft(), game::cancel_activity_or_ignore_query(), game::cancel_activity_query(), activity_handlers::craft_do_turn(), autodrive_activity_actor::do_turn(), drop_activity_actor::do_turn(), stash_activity_actor::do_turn(), pickup_activity_actor::do_turn(), avatar_action::eat(), fall_asleep(), forced_dismount(), game::forced_door_closing(), item::handle_craft_failure(), mattack::pull_metal_weapon(), npc::reboot(), DefaultRemovePartHandler::removed(), autodrive_activity_actor::start(), activity_handlers::start_fire_do_turn(), and stop_hauling().
| void Character::cancel_stashed_activity | ( | ) |
Definition at line 967 of file character.cpp.
References stashed_outbounds_activity, and stashed_outbounds_backlog.
Referenced by assign_activity(), and assign_stashed_activity().
| bool Character::change_side | ( | item & | it, |
| bool | interactive = true |
||
| ) |
Swap side on which item is worn; returns false on fail.
If interactive is false, don't alert player or drain moves
Definition at line 3695 of file character.cpp.
References _, Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), can_swap(), m_info, Creature::mod_moves(), reset_encumbrance(), cata::hash64_detail::ret, item::swap_side(), and item::tname().
Referenced by npc::adjust_worn(), change_side(), examine_item_menu::run(), and player::sort_armor().
| bool Character::change_side | ( | item_location & | loc, |
| bool | interactive = true |
||
| ) |
Definition at line 3727 of file character.cpp.
References _, Creature::add_msg_player_or_npc(), change_side(), is_worn(), and m_info.
| bool Character::check_and_recover_morale | ( | ) |
Checks permanent morale for consistency and recovers it when an inconsistency is found.
Definition at line 9127 of file character.cpp.
References add_msg(), apply_persistent_morale(), disp_name(), Creature::effects, effect::get_bp(), get_fatigue(), effect::get_id(), effect::get_intensity(), get_mutations(), Creature::get_pain(), get_painkiller(), Creature::get_perceived_pain(), get_stored_kcal(), get_thirst(), effect::is_removed(), m_debug, morale, player_morale::on_effect_int_change(), player_morale::on_item_wear(), player_morale::on_mutation_gain(), player_morale::on_stat_change(), and worn.
Referenced by game::do_turn().
| void Character::check_item_encumbrance_flag | ( | ) |
Checks worn items for the "RESET_ENCUMBRANCE" flag, which indicates that encumbrance may have changed and require recalculating.
Definition at line 1841 of file character.cpp.
References check_encumbrance, reset_encumbrance(), and worn.
| bool Character::check_mount_is_spooked | ( | ) |
Definition at line 1102 of file character.cpp.
References Creature::A_HOSTILE, effect_saddled, forced_dismount(), g, get_dex(), get_str(), HOSTILE_CLOSE, is_mounted(), mounted_creature, pos(), rl_dist(), sees(), and x_in_y().
Referenced by game::do_turn().
| bool Character::check_mount_will_move | ( | const tripoint & | dest_loc | ) |
Definition at line 1084 of file character.cpp.
References _, Creature::A_HOSTILE, Creature::add_msg_if_player(), g, HOSTILE_CLOSE, is_mounted(), mounted_creature, pos(), rl_dist(), and sees().
Referenced by avatar_action::move().
| void Character::check_needs_extremes | ( | ) |
Kills the player if too hungry, stimmed up etc., forces tired player to sleep and prints warnings.
Intelligence slightly decreases occurrence of short naps when dead tired Intelligence slightly decreases occurrence of short naps when exhausted Perception slightly decreases occurrence of short naps when sleep deprived Perception slightly increases resilience against passing out from sleep deprivationDefinition at line 4964 of file character.cpp.
References _, Creature::add_effect(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), dead, dead_tired, dies_from_drug_overdose, dies_of_starvation, dies_of_thirst, effect_adrenaline, effect_drunk, effect_jetinjector, effect_lack_sleep, effect_meth, efftype_id, exhausted, fall_asleep(), falls_asleep_from_exhaustion, g, Creature::get_effect_dur(), Creature::get_effect_int(), get_fatigue(), get_kcal_percent(), get_painkiller(), get_per(), get_sleep_deprivation(), get_stim(), get_stored_kcal(), get_thirst(), getID(), harmless, Creature::has_effect(), has_trait(), in_sleep_state(), int_cur, Creature::is_player(), lerp(), m_bad, m_warning, major, massive, mapgen_defer::message, minor, mod_fatigue(), mod_healthy_mod(), calendar::once_every(), one_in(), parched, snippet_library::random_from_category(), serious, set_fatigue(), Creature::set_part_hp_cur(), sleep_deprivation, SNIPPET, and trait_NOPAIN.
Referenced by update_body().
| bool Character::check_outbounds_activity | ( | const player_activity & | act, |
| bool | check_only = false |
||
| ) |
Definition at line 996 of file character.cpp.
References act, activity, add_msg(), backlog, disp_name(), get_map(), map::getlocal(), map::inbounds(), Creature::is_npc(), m_debug, pos(), stashed_outbounds_activity, stashed_outbounds_backlog, tripoint_min, and tripoint_zero.
Referenced by player_activity::do_turn(), and npc::move().
| int Character::clairvoyance | ( | ) | const |
Returns the distance the player can see through walls.
Definition at line 802 of file character.cpp.
References MAX_CLAIRVOYANCE, VISION_CLAIRVOYANCE, VISION_CLAIRVOYANCE_PLUS, VISION_CLAIRVOYANCE_SUPER, and vision_mode_cache.
Referenced by sees().
| void Character::clear_bionics | ( | ) |
| void Character::clear_destination | ( | ) |
Definition at line 10470 of file character.cpp.
References auto_move_route, clear_destination_activity(), destination_point, next_expected_position, and cata::nullopt.
Referenced by game::cancel_activity_query(), cancel_auto_move(), migration_cancel_activity_actor::do_turn(), game::handle_action(), avatar_action::move(), npc::reboot(), npc::revert_after_activity(), start_destination_activity(), game::try_get_left_click_action(), and game::try_get_right_click_action().
| void Character::clear_destination_activity | ( | ) |
Definition at line 1023 of file character.cpp.
References destination_activity.
Referenced by clear_destination().
| void Character::clear_miss_reasons | ( | ) |
Clears the list of reasons for why the player would miss a melee attack.
Definition at line 324 of file melee.cpp.
References melee_miss_reasons.
Referenced by player::process_turn().
| void Character::clear_morale | ( | ) |
| void Character::clear_mutations | ( | ) |
Empties the trait and mutations lists.
Definition at line 2882 of file newcharacter.cpp.
References cached_mutations, my_mutations, my_traits, toggle_trait(), and unset_mutation().
Referenced by npc::randomize(), and reset_scenario().
| void Character::clear_skills | ( | ) |
Clear the skills map, setting all levels to 0.
Definition at line 2893 of file newcharacter.cpp.
References _skills.
Referenced by reset_scenario().
Definition at line 328 of file consumption.cpp.
References item::components, compute_default_effective_nutrients(), compute_effective_nutrients(), flag_BYPRODUCT(), flag_NUTRIENT_OVERRIDE(), item::has_flag(), item::is_comestible(), and item::recipe_charges.
Referenced by can_eat(), comestible_inventory_preset::comestible_inventory_preset(), compute_effective_nutrients(), consume_effects(), player::eat(), find_auto_consume(), nutrition_for(), and will_eat().
| std::pair< nutrients, nutrients > Character::compute_nutrient_range | ( | const item & | comest, |
| const recipe_id & | recipe_i, | ||
| const cata::flat_set< std::string > & | extra_flags = {} |
||
| ) | const |
Get calorie & vitamin contents for a comestible, taking into account character traits.
Get range of possible nutrient content, for a particular recipe, depending on choice of ingredients
Definition at line 354 of file consumption.cpp.
References recipe::byproducts, compute_default_effective_nutrients(), compute_nutrient_range(), item::count(), flag_COOKED(), flag_NUTRIENT_OVERRIDE(), requirement_data::get_components(), item::has_flag(), recipe::hot_result(), cata::flat_set< T, Compare, Data >::insert(), item::is_comestible(), nutrients::max_in_place(), nutrients::min_in_place(), recipe::simple_requirements(), and calendar::turn.
Referenced by compute_nutrient_range().
| std::pair< nutrients, nutrients > Character::compute_nutrient_range | ( | const itype_id & | comest_id, |
| const cata::flat_set< std::string > & | extra_flags = {} |
||
| ) | const |
Same, but across arbitrary recipes.
Definition at line 418 of file consumption.cpp.
References itype::comestible, compute_default_effective_nutrients(), compute_nutrient_range(), item::contents, recipe::create_result(), debugmsg, flag_NUTRIENT_OVERRIDE(), item_contents::front(), itype::get_id(), itype::has_flag(), recipe_dictionary::is_item_on_loop(), nutrients::max_in_place(), nutrients::min_in_place(), item_contents::num_item_stacks(), recipe_dict, itype::recipes, string_id< T >::str(), calendar::turn, and item::typeId().
| void Character::conduct_blood_analysis | ( | ) | const |
Definition at line 2024 of file character.cpp.
References _, action, c_green, c_red, c_white, PATH_INFO::colors(), draw_border(), e_good, Creature::effects, g, input_context::handle_input(), line(), catacurses::newwin(), ui_manager::redraw(), input_context::register_action(), string_format(), TERMX, TERMY, trim_and_print(), and catacurses::wnoutrefresh().
Referenced by activate_bionic(), and iexamine::autodoc().
| bool Character::consume_charges | ( | item & | used, |
| int | qty | ||
| ) |
Consume charges of a tool or comestible item, potentially destroying it in the process.
| used | item consuming the charges |
| qty | number of charges to consume which must be non-zero |
Definition at line 7515 of file character.cpp.
References item::ammo_consume(), item::ammo_remaining(), item::ammo_required(), Creature::as_player(), item::charges, debugmsg, flag_USE_UPS(), has_charges(), item::has_flag(), i_rem(), item::is_food(), item::is_medication(), item::is_power_armor(), item::is_tool(), itype_bio_armor, itype_UPS, pos(), and use_charges().
Referenced by chop_plank_activity(), chop_tree_activity(), feedpet(), activity_handlers::firstaid_finish(), npc::heal_player(), npc::heal_self(), invoke_item(), activity_handlers::jackhammer_finish(), petfood(), activity_handlers::pickaxe_finish(), npc::pretend_heal(), activity_handlers::repair_item_finish(), activity_handlers::shear_finish(), and activity_handlers::start_fire_finish().
| bool Character::consume_effects | ( | item & | food | ) |
Handles the effects of consuming an item.
Definition at line 1157 of file consumption.cpp.
References _, Creature::add_effect(), add_msg(), Creature::add_msg_if_player(), bio_digestion, itype::can_use(), clamp(), itype::comestible, compute_effective_nutrients(), debugmsg, effect_bloated, effect_tapeworm, flag_NO_BLOAT(), g, stomach_contents::get_calories(), item::get_comestible(), item::get_contained(), item::get_relative_rot(), get_stored_kcal(), get_thirst(), item::has_any_flag(), has_bionic(), Creature::has_effect(), item::has_flag(), has_trait(), healall(), herbivore_blacklist(), stomach_contents::ingest(), item::is_comestible(), item::is_container(), Creature::is_npc(), m_debug, m_good, m_mixed, max_stored_kcal(), mod_healthy_mod(), Creature::mod_pain(), mod_stored_kcal(), mod_thirst(), modify_addiction(), modify_fatigue(), modify_health(), modify_morale(), modify_radiation(), modify_stimulation(), mon_player_blob, nutrition_for(), pos(), roll_remainder(), slaked, stomach, trait_EATHEALTH, trait_GOURMAND, trait_HERBIVORE, trait_PROJUNK2, trait_RUMINANT, trait_SAPROPHAGE, trait_SAPROVORE, trait_SLIMESPAWNER, trait_THRESH_PLANT, and item::type.
Referenced by player::consume_med(), player::eat(), iuse::ecig(), and try_consume().
| int Character::consume_remote_fuel | ( | int | amount | ) |
Consume fuel used by remote powered bionic, return amount of request unfulfilled (0 if totally successful).
Definition at line 1410 of file bionics.cpp.
References item::active, flag_CABLE_SPOOL(), get_map(), has_charges(), item::has_flag(), visitable< Character >::items_with(), itype_adv_UPS_off, itype_UPS_off, pos(), roll_remainder(), and use_charges().
Referenced by burn_fuel().
| void Character::cough | ( | bool | harmful = false, |
| int | loudness = 4 |
||
| ) |
Definition at line 7647 of file character.cpp.
References _, Creature::add_effect(), add_msg(), apply_damage(), effect_cough_suppress, effect_recently_coughed, get_stamina(), get_stamina_max(), Creature::has_effect(), Creature::is_npc(), m_bad, mod_stamina(), Creature::moves, one_in(), pos(), sounds::sound(), sounds::speech, and x_in_y().
Referenced by eff_fun_fungus(), and player::process_one_effect().
| bool Character::covered_with_flag | ( | const std::string & | flag, |
| const body_part_set & | parts | ||
| ) | const |
Definition at line 8972 of file character.cpp.
References body_part_set::none(), and worn.
Referenced by is_waterproof().
| const inventory & Character::crafting_inventory | ( | bool | clear_path | ) |
Definition at line 553 of file crafting.cpp.
References crafting_inventory(), PICKUP_RANGE, and tripoint_zero.
Referenced by iexamine::autodoc(), autodoc_internal(), game::butcher(), activity_handlers::butcher_finish(), butcher_submenu(), can_butcher_at(), player::can_continue_craft(), can_do_activity_there(), player::can_make(), player::can_start_craft(), complete_craft(), veh_interact::complete_vehicle(), consider_butchery(), construction_color(), activity_handlers::cracking_do_turn(), iuse::craft(), crafting_inventory(), iexamine::cvdmachine(), iuse::dig(), game_menus::inv::disassemble(), wash_activity_actor::finish(), bionic_install_preset::get_failure_chance(), repair_item_actor::handle_components(), has_enough_anesth(), list_available_constructions(), player::mend_item(), activity_handlers::mend_item_finish(), mill_load_food(), modify_morale(), veh_utils::most_repairable_part(), iexamine::nanofab(), iexamine::pit(), prompt_disassemble_in_seq(), examine_item_menu::rate_action_disassemble(), veh_utils::repair_part(), iexamine::safe(), deduped_requirement_data::select_alternative(), select_crafting_recipe(), iexamine::sign(), smoker_load_food(), iexamine::tree_maple(), disassemble_activity_actor::try_start_single(), sew_advanced_actor::use(), and wash_items().
| const inventory & Character::crafting_inventory | ( | const tripoint & | src_pos = tripoint_zero, |
| int | radius = PICKUP_RANGE, |
||
| bool | clear_path = true |
||
| ) |
Definition at line 558 of file crafting.cpp.
References bionic_data::activated, cached_crafting_inventory, cached_moves, cached_position, cached_time, bionic_data::fake_item, inventory::form_from_map(), get_power_level(), has_trait(), inv, string_id< T >::is_empty(), Creature::moves, my_bionics, pos(), units::to_kilojoule(), trait_BURROW, tripoint_zero, calendar::turn, inventory::update_quality_cache(), weapon, and worn.
| double Character::crit_chance | ( | float | roll_hit, |
| float | target_dodge, | ||
| const item & | weap | ||
| ) | const |
Returns the chance to critical given a hit roll and target's dodge roll.
Unarmed increases critical chance with UNARMED_WEAPON Dexterity increases chance for critical hits Perception increases chance for critical hits Bashing increases critical chance with bashing weapons Cutting increases critical chance with cutting weapons Stabbing increases critical chance with piercing weapons Unarmed increases critical chance with unarmed weapons Melee slightly increases critical chance with any itemDefinition at line 742 of file melee.cpp.
References bio_cqb, BIO_CQB_LEVEL, melee_statistic_data::crit_chance, melee_statistic_data::crit_count, dex_cur, melee_statistic_data::double_crit_chance, melee_statistic_data::double_crit_count, get_skill_level(), has_active_bionic(), item::is_unarmed_weapon(), limit_probability(), itype::m_to_hit, item::melee_skill(), melee::melee_stats, per_cur, skill_melee, skill_unarmed, and item::type.
Referenced by item::effective_dps(), and scored_crit().
| bool Character::crossed_threshold | ( | ) | const |
Returns true if the player has crossed a mutation threshold Player can only cross one mutation threshold.
Definition at line 8716 of file character.cpp.
References get_mutations(), and mutation_branch::threshold.
Referenced by character_display::disp_info(), draw_tip(), player::hardcoded_effects(), marloss_common(), modify_morale(), conditional_t< T >::set_has_trait_flag(), and test_crossing_threshold().
| bool Character::deactivate_bionic | ( | int | b, |
| bool | eff_only = false |
||
| ) |
Handles bionic deactivation effects of the entered bionic, returns if anything deactivated.
Definition at line 1064 of file bionics.cpp.
References _, add_bionic(), Creature::add_msg_if_npc(), Creature::add_msg_if_player(), bionic::ammo_count, item::ammo_data(), bionic::ammo_loaded, item::ammo_remaining(), b, bio_ads, bio_cqb, bio_remote, bio_tools, bionic_TOOLS_EXTEND, disp_name(), bionic_data::enchantments, bionic::energy_stored, bionic_data::fake_item, flag_BIONIC_TOGGLED, flag_BIONIC_WEAPON, g, itype::get_id(), get_power_level(), Creature::get_value(), has_active_item(), has_bionic(), bionic_data::has_flag(), bionic::id, bionic::incapacitated_time, bionic::info(), invalidate_crafting_inventory(), string_id< T >::is_empty(), bionic_data::is_remote_fueled, itype_radiocontrol, itype_remotevehcontrol, m_info, m_neutral, martial_arts_data, mod_power_level(), bionic_data::name, string_id< itype >::NULL_ID(), pos(), bionic_data::power_deactivate, bionic::powered, recalculate_enchantment_cache(), reset(), reset_encumbrance(), reset_remote_fuel(), Creature::set_value(), item::tname(), item::typeId(), and weapon.
Referenced by absorb_hit(), burn_fuel(), npc::deactivate_bionic_by_id(), player::power_bionics(), process_bionic(), and uninstall_bionic().
| void Character::deactivate_mutation | ( | const trait_id & | mut | ) |
Definition at line 610 of file mutation.cpp.
References apply_mods(), mutation_branch::enchantments, Creature::mod_moves(), my_mutations, string_id< T >::obj(), recalc_sight_limits(), recalculate_enchantment_cache(), switch_mutations(), and mutation_branch::transform.
Referenced by player::power_mutations(), and player::power_mutations_ui().
|
overridevirtual |
Calls Creature::deal_damage and handles damaged effects (waking up, etc.)
Dexterity increases chance to avoid being grabbedReimplemented from Creature.
Definition at line 8459 of file character.cpp.
References _, scrollingcombattext::add(), damage_instance::add_damage(), Creature::add_effect(), add_msg(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), AEP_SNAKES, body_part_name(), bp_torso, Creature::deal_damage(), debugmsg, direction_from(), Creature::disp_name(), disp_name(), DT_ACID, DT_BASH, DT_CUT, DT_STAB, effect_bite, effect_blind, effect_grabbed, effect_grabbing, effect_infected, g, get_dex(), Creature::get_effect_int(), get_hp_bar(), Creature::get_hp_max(), has_artifact_with(), Creature::has_effect(), Creature::has_flag(), has_grab_break_tec(), has_trait(), Creature::is_hallucination(), Creature::is_player(), m_bad, m_good, m_info, m_neutral, m_warning, MAX_RECOIL, MF_GRABS, mon_player_blob, mon_shadow_snake, num_bp, on_hurt(), one_in(), point_zero, Creature::pos(), pos(), Creature::posx(), posx(), Creature::posy(), posy(), recoil, rl_dist(), rng(), SCT, trapfunc::snake(), dealt_damage_instance::total_damage(), trait_ACIDBLOOD, trait_DEBUG_NODMG, trait_SLIMESPAWNER, dealt_damage_instance::type_damage(), item::volume(), weapon, worn, and x_in_y().
Referenced by mattack::bio_op_impale(), mattack::bio_op_takedown(), map::burn_body_part(), map::crush(), trapfunc::dissector(), explosion_handler::do_blast(), map::drop_furniture(), eff_fun_onfire(), forced_dismount(), trapfunc::goo(), hitall(), player::impact(), player::knock_back_to(), game::knockback(), trapfunc::lava(), melee_special_effects(), petfood(), trapfunc::pit(), trapfunc::pit_glass(), trapfunc::pit_spikes(), game::place_player(), map::player_in_field(), smash(), trapfunc::snare_heavy(), and mattack::thrown_by_judo().
| bool Character::defer_move | ( | const tripoint & | next | ) |
Definition at line 10544 of file character.cpp.
References auto_move_route, has_destination(), next_expected_position, pos(), and square_dist().
Referenced by avatar_action::move().
| void Character::did_hit | ( | Creature & | target | ) |
Definition at line 8392 of file character.cpp.
References enchantment_cache.
Referenced by melee_attack().
|
overridevirtual |
Empty function.
Should always be overwritten by the appropriate player/NPC/monster version.
Implements Creature.
Reimplemented in npc.
Definition at line 3482 of file character.cpp.
References inventory::add_item(), effect_beartrap, effect_heavysnare, effect_lightsnare, g, Creature::has_effect(), inv, itype_beartrap, itype_rope_6, itype_snare_trigger, itype_string_36, mission::on_creature_death(), Creature::set_killer(), set_time_died(), calendar::start_of_cataclysm, and calendar::turn.
Referenced by debug_menu::debug(), and npc::die().
| void Character::dismount | ( | ) |
Definition at line 1247 of file character.cpp.
References _, monster::add_effect(), add_msg(), character_id, choose_adjacent(), CMM_WALK, effect_ai_waiting, effect_ridden, effect_riding, g, monster::has_flag(), Creature::is_avatar(), string_id< T >::is_empty(), is_mounted(), m_debug, m_warning, mtype::mech_weapon, MF_RIDEABLE_MECH, Creature::mod_moves(), mounted_creature, monster::mounted_player, monster::mounted_player_id, OBJECT_NONE, Creature::remove_effect(), visitable< Character >::remove_item(), set_movement_mode(), setpos(), monster::type, item::typeId(), and weapon.
Referenced by game::handle_action().
|
overridevirtual |
Returns either "you" or the player's name.
capitalize_first assumes that the character's name is already upper case and uses it only for possessive "your" and "you"
Implements Creature.
Definition at line 546 of file character.cpp.
References _, Creature::is_player(), name, and string_format().
Referenced by activity_on_turn_move_loot(), add_addiction(), iuse::artifact(), talk_function::assign_camp(), iexamine::autodoc(), best_installer(), bionics_install_failure(), activity_handlers::build_do_turn(), can_uninstall_bionic(), npc::character_danger(), game::chat(), check_and_recover_morale(), npc::check_or_use_weapon_cbm(), check_outbounds_activity(), complete_construction(), deactivate_bionic(), deal_damage(), faction_manager::display(), npc::do_npc_read(), npc::do_player_activity(), avatar::do_read(), npc::execute_action(), fetch_activity(), npc::finish_read(), talk_function::goto_location(), npc::handle_sound(), npc::heal_player(), npc::heal_self(), install_bionics(), game::list_missions(), npc::method_of_attack(), talk_function::morale_chat(), talk_function::morale_chat_activity(), npc::mutiny(), npc::npc_dismount(), game::npc_menu(), mattack::nurse_operate(), monster::nursebot_operate(), player::on_hit(), npc::on_load(), npc::pretend_fire(), npc::pretend_heal(), monster::print_info(), npc::reach_omt_destination(), avatar::read(), game_menus::inv::read(), requirements_map(), talk_effect_fun_t::set_consume_item(), npc::set_fac(), npc::set_known_to_u(), talk_function::start_camp(), player::uncanny_dodge(), uninstall_bionic(), trading_window::update_win(), musical_instrument_actor::use(), heal_actor::use_healing_item(), and npc::use_painkiller().
|
virtual |
Drop, wear, stash or otherwise try to dispose of an item consuming appropriate moves.
| obj | item to dispose of |
| prompt | optional message to display in any menu |
Reimplemented in npc.
Definition at line 7366 of file character.cpp.
References _, action, inventory::add_item_keep_invlet(), uilist::addentry(), Creature::as_player(), can_wear(), deliberate, enabled, inv, item_handling_cost(), item_store_cost(), item_wear_cost(), Creature::moves, pickup::prompt, ptr(), put_into_vehicle_or_drop(), uilist::query(), visitable< T >::remove_item(), uilist::ret, string_format(), uilist::text, inventory::unsort(), utf8_width(), volume_capacity(), volume_carried(), wear_item(), and worn.
Referenced by activate_bionic(), item::reload(), and player::unwield().
| void Character::do_damage_for_bionic_failure | ( | int | min_damage, |
| int | max_damage | ||
| ) |
Definition at line 2351 of file bionics.cpp.
References _, Creature::add_effect(), Creature::add_msg_player_or_npc(), apply_damage(), body_part_name_accusative(), effect_infected, effect_under_op, Creature::get_all_body_parts(), Creature::get_hp(), Creature::has_effect(), m_bad, and rng().
Referenced by bionics_install_failure(), and bionics_uninstall_failure().
|
protected |
Definition at line 3532 of file character.cpp.
References _, _skills, Creature::add_msg_if_player(), bio_memory, get_power_level(), has_active_bionic(), has_trait_flag(), Skill::is_combat_skill(), SkillLevel::level(), m_bad, m_warning, mod_power_level(), mod_stim(), Skill::name(), calendar::once_every(), one_in(), SkillLevel::rust(), and rust_rate().
Referenced by update_body().
| void Character::drench | ( | int | saturation, |
| const body_part_set & | flags, | ||
| bool | ignore_waterproof | ||
| ) |
Drenches the player with water, saturation is the percent gotten wet.
Definition at line 1754 of file suffer.cpp.
References _, Creature::add_msg_if_player(), all_body_parts, body_wetness, bp_torso, drench_capacity, effect_masked_scent, effect_onfire, Creature::get_value(), has_active_mutation(), Creature::has_effect(), has_trait(), is_waterproof(), is_weak_to_water(), m_bad, m_info, Creature::remove_effect(), restore_scent(), body_part_set::test(), trait_DEBUG_NOTEMP, trait_SHELL2, and x_in_y().
Referenced by player::pause(), game::place_player(), and avatar_action::swim().
| void Character::drench_mut_calc | ( | ) |
Recalculates mutation drench protection for all bodyparts (ignored/good/neutral stats)
Definition at line 7946 of file character.cpp.
References all_body_parts, get_mutations(), mut_drench, neutral, mutation_branch::protection, WT_GOOD, WT_IGNORED, and WT_NEUTRAL.
Referenced by avatar::load(), mutate_towards(), remove_mutation(), and game::start_game().
|
virtual |
Reimplemented in npc.
Definition at line 2527 of file character.cpp.
References _, Creature::add_msg_player_or_npc(), assign_activity(), get_map(), m_info, pos(), and rl_dist().
| void Character::drop | ( | item_location | loc, |
| const tripoint & | where | ||
| ) |
Drops an item to the specified location.
Definition at line 2505 of file character.cpp.
References add_msg(), Creature::as_player(), player::can_takeoff(), can_unwield(), item::count(), drop(), is_wearing(), is_wielding(), m_info, and cata::hash64_detail::ret.
Referenced by game::drop(), npc::drop(), drop(), game::drop_in_direction(), harvest_common(), i_add_or_drop(), examine_item_menu::run(), suffer_from_schizophrenia(), and player::takeoff().
| void Character::drop_invalid_inventory | ( | ) |
Definition at line 3198 of file character.cpp.
References _, map::add_item_or_charges(), Creature::add_msg_if_player(), inventory::const_slice(), get_map(), i_rem(), inv, LIQUID, m_bad, item::made_of(), pos(), put_into_vehicle_or_drop(), inventory::remove_randomly_by_volume(), tumbling, volume_capacity(), and volume_carried().
Referenced by absorb_hit(), player_activity::do_turn(), npc::execute_action(), player::process_turn(), and npc_trading::trade().
| int Character::effective_dispersion | ( | int | dispersion | ) | const |
Definition at line 567 of file character.cpp.
References bp_eyes, encumb(), and ranged_per_mod().
Referenced by get_aim_types(), get_fastest_sight(), get_most_accurate_sight(), player::gun_value(), target_ui::panel_recoil(), print_aim(), and target_ui::run().
| int Character::encumb | ( | body_part | bp | ) | const |
Returns ENC provided by armor, etc.
Definition at line 4001 of file character.cpp.
References encumbrance_cache.
Referenced by aim_speed_encumbrance_modifier(), attack_cost(), iexamine::bars(), spell::casting_time(), casting_time_encumbered(), trap::detect_trap(), effective_dispersion(), item::effective_dps(), spell::energy_cost(), energy_cost_encumbered(), player::fall_damage_mod(), get_encumbrance(), get_miss_reason(), get_shout_volume(), player::get_weapon_dispersion(), player::gun_value(), hit_roll(), item_handling_cost(), melee_attack(), recalc_sight_limits(), player::reset_stats(), run_cost(), shout(), spell::spell_fail(), suffer_from_other_mutations(), swim_speed(), player::throw_item(), update_bodytemp(), update_stamina(), activity_handlers::vibe_do_turn(), and wear_item().
| void Character::enforce_minimum_healing | ( | ) |
Definition at line 4611 of file character.cpp.
References Creature::get_all_body_parts(), Creature::get_part_healed_total(), heal(), and Creature::set_part_healed_total().
Referenced by update_body().
| bool Character::enough_power_for | ( | const bionic_id & | bid | ) | const |
Definition at line 2019 of file character.cpp.
References bionic_data::power_activate, and power_level.
Referenced by activate_bionic(), and iexamine::fireplace().
| std::string Character::enumerate_unmet_requirements | ( | const item & | it, |
| const item & | context = item() |
||
| ) | const |
Returns a string of missed requirements (both stats and skills)
Definition at line 3376 of file character.cpp.
References _, item::contextualize_skill(), enumerate_as_string(), get_dex(), get_int(), item::get_min_str(), get_per(), get_skill_level(), get_str(), itype::min_dex, itype::min_int, itype::min_per, itype::min_skills, name, Skill::name(), string_format(), and item::type.
Referenced by can_use(), and gunmod_inventory_preset::get_denial().
| float Character::env_surgery_bonus | ( | int | radius | ) |
Calculate skill bonus from tiles in radius.
Definition at line 2230 of file bionics.cpp.
References map::furn(), get_map(), map::points_in_radius(), pos(), and furn_t::surgery_skill_multiplier.
Referenced by bionics_adjusted_skill().
| body_part_set Character::exclusive_flag_coverage | ( | const std::string & | flag | ) | const |
Bitset of all the body parts covered only with items with flag (or nothing)
Definition at line 4044 of file character.cpp.
References body_part_set::all(), cata::hash64_detail::ret, and worn.
Referenced by apply_wetness_morale(), mut_cbm_encumb(), mutation_attacks(), player::reset_stats(), and swim_speed().
| void Character::expose_to_disease | ( | diseasetype_id | dis_type | ) |
Determine if character is susceptible to dis_type and if so apply the symptoms.
Definition at line 1624 of file character.cpp.
References Creature::add_effect(), disease_type::affected_bodyparts, get_healthy(), disease_type::health_threshold, disease_type::max_duration, disease_type::max_intensity, disease_type::min_duration, disease_type::min_intensity, num_bp, rng(), disease_type::symptoms, and cata::optional< T >::value().
Referenced by player::eat().
|
overridevirtual |
Implements Creature.
Reimplemented in npc.
Definition at line 6609 of file character.cpp.
References _, body_part_name_as_heading(), c_white, colorize(), enumerate_as_string(), Creature::get_all_body_parts(), get_hp_bar(), Creature::get_part_hp_cur(), Creature::get_part_hp_max(), int_id< T >::id(), item::is_null(), Creature::is_player(), left_justify(), limb_color(), male, name, replace_colors(), string_format(), item::tname(), utf8_width(), weapon, and worn.
Referenced by npc::extended_description().
| int Character::extraEncumbrance | ( | layer_level | level, |
| int | bp | ||
| ) | const |
Get encumbrance penalty per layer & body part.
Definition at line 3690 of file character.cpp.
References encumbrance_cache.
| void Character::fall_asleep | ( | ) |
Adds "sleep" to the player.
Definition at line 9272 of file character.cpp.
References _, Creature::add_msg_if_player(), bmr(), fall_asleep(), g, get_stored_kcal(), get_thirst(), has_active_mutation(), Creature::is_avatar(), is_snuggling(), m_bad, max_stored_kcal(), one_in(), pgettext(), thirsty, and trait_HIBERNATE.
Referenced by check_needs_extremes(), fall_asleep(), iexamine::flower_poppy(), player::hardcoded_effects(), introduce_into_anesthesia(), marloss_common(), iuse::mycus(), player::process_one_effect(), suffer_from_stimulants(), suffer_while_awake(), try_reject_mutagen(), activity_handlers::try_sleep_do_turn(), and mutagen_iv_actor::use().
| void Character::fall_asleep | ( | const time_duration & | duration | ) |
Definition at line 9308 of file character.cpp.
References ACT_TRY_SLEEP, activity, Creature::add_effect(), cancel_activity(), effect_sleep, player_activity::id(), and player_activity::set_to_null().
| bool Character::feed_furnace_with | ( | item & | it | ) |
Definition at line 1319 of file consumption.cpp.
References _, Creature::add_msg_player_or_npc(), can_feed_furnace_with(), item::charges, item::charges_per_volume(), item::count_by_charges(), units::from_kilojoule(), furnace, furnace_max_volume, g, get_acquirable_energy(), get_max_power_level(), get_power_level(), item::is_favorite, is_max_power(), m_info, Creature::mod_moves(), mod_power_level(), item::tname(), units::to_kilojoule(), and vgettext().
Referenced by player::consume_item().
| bool Character::feed_reactor_with | ( | item & | it | ) |
Recharge CBMs whenever possible.
Definition at line 1275 of file consumption.cpp.
References _, Creature::add_msg_player_or_npc(), can_feed_reactor_with(), item::charges, get_acquirable_energy(), Creature::mod_moves(), plut_charges, PLUTONIUM_CHARGES, query_yn(), reactor, tank_plut, item::tname(), and item::typeId().
Referenced by player::consume_item().
| std::vector< item_location > Character::find_ammo | ( | const item & | obj, |
| bool | empty = true, |
||
| int | radius = 1 |
||
| ) | const |
Searches for ammo or magazines that can be used to reload obj.
| obj | item to be reloaded. By design any currently loaded ammunition or magazine is ignored |
| empty | whether empty magazines should be considered as possible ammo |
| radius | adjacent map/vehicle tiles to search. 0 for only player tile, -1 for only inventory |
Definition at line 2676 of file character.cpp.
References find_ammo_helper(), and pos().
Referenced by ammo_count_for(), item::color_in_inventory(), and player::list_ammo().
| std::vector< item_location > Character::find_reloadables | ( | ) |
Searches for weapons and magazines that can be reloaded.
Definition at line 2694 of file character.cpp.
References item::is_gun(), item::is_holster(), item::magazine_compatible(), SKIP, and visitable< Character >::visit_items().
Referenced by avatar_action::reload_weapon().
| itype_id Character::find_remote_fuel | ( | bool | look_only = false | ) |
Find fuel used by remote powered bionic.
Definition at line 1356 of file bionics.cpp.
References item::active, visitable< Character >::charges_of(), flag_CABLE_SPOOL(), fuel_type_battery, fuel_type_sun_light, get_map(), has_charges(), item::has_flag(), is_night(), map::is_outside(), visitable< Character >::items_with(), itype_adv_UPS_off, itype_UPS_off, max_power_level, pos(), Creature::set_value(), units::to_kilojoule(), to_string(), calendar::turn, and map::veh_at().
Referenced by burn_fuel(), iuse::cable_attach(), draw_bionics_titlebar(), and process_bionic().
| void Character::flag_encumbrance | ( | ) |
Flag encumbrance for updating.
Definition at line 1836 of file character.cpp.
References check_encumbrance.
Referenced by item::on_pickup(), and item::on_wield().
|
static |
Warmth from terrain, furniture, vehicle furniture and traps.
Can be negative.
Definition at line 9465 of file character.cpp.
References f_null, floor_bedding_warmth(), furn_t::floor_bedding_warmth, trap::floor_bedding_warmth, map::furn(), get_map(), trap::is_null(), int_id< T >::obj(), optional_vpart_position::part_with_feature(), pos(), t_improvised_shelter, map::ter(), map::tr_at(), and map::veh_at().
Referenced by floor_bedding_warmth(), and floor_warmth().
|
static |
Warmth from clothing on the floor.
Definition at line 9491 of file character.cpp.
References bp_leg_l, bp_leg_r, bp_torso, vehicle::get_items(), get_map(), map::i_at(), optional_vpart_position::part_with_feature(), pos(), map::veh_at(), vehicle::vehicle(), and VPFLAG_CARGO.
Referenced by floor_warmth().
| int Character::floor_warmth | ( | const tripoint & | pos | ) | const |
Final warmth from the floor.
Definition at line 9526 of file character.cpp.
References bodytemp_modifier_traits_floor(), floor_bedding_warmth(), floor_item_warmth(), has_trait(), pos(), and trait_DOWN.
Referenced by update_bodytemp().
| double Character::footwear_factor | ( | ) | const |
Returns 1 if the player is wearing something on both feet, .5 if on one, and 0 if on neither.
Definition at line 8935 of file character.cpp.
References cata::hash64_detail::ret, and wearing_something_on().
Referenced by is_immune_effect(), game::knockback(), rooted(), run_cost(), and game::walk_move().
| void Character::forced_dismount | ( | ) |
Definition at line 1148 of file character.cpp.
References _, activity, Creature::add_effect(), add_msg(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), cancel_activity(), character_id, Creature::check_dead_state(), CMM_WALK, deal_damage(), DT_BASH, effect_ai_waiting, effect_downed, effect_ridden, effect_riding, g, get_dodge(), get_map(), Creature::is_avatar(), m_bad, m_debug, m_warning, MF_RIDEABLE_MECH, mounted_creature, Creature::moves, num_bp, OBJECT_NONE, one_in(), pgettext(), points_in_radius(), pos(), random_entry(), Creature::remove_effect(), visitable< Character >::remove_item(), rng(), set_movement_mode(), setpos(), and weapon.
Referenced by Creature::add_effect(), check_mount_is_spooked(), monster::die(), and monster::setpos().
| bool Character::fuel_bionic_with | ( | item & | it | ) |
Definition at line 1377 of file consumption.cpp.
References Creature::add_msg_player_or_npc(), can_fuel_bionic_with(), item::charges, get_bionic_fueled_with(), get_fuel_capacity(), get_most_efficient_bionic(), Creature::get_value(), m_info, Creature::mod_moves(), bionic_data::name, Creature::set_value(), string_id< T >::str(), item::tname(), to_string(), item::typeId(), update_fuel_storage(), and vgettext().
Referenced by player::consume_item().
| std::pair< int, int > Character::fun_for | ( | const item & | comest | ) | const |
Handles the enjoyability value for a comestible.
First value is enjoyability, second is cap.
Definition at line 465 of file consumption.cpp.
References consumption_event::component_hash, consumption_history, flag_FELINE(), flag_LUPINE(), flag_NEGATIVE_MONOTONY_OK(), item::get_comestible(), item::get_comestible_fun(), item::get_relative_rot(), item::has_flag(), has_trait(), item::is_comestible(), item::make_component_hash(), consumption_event::time, trait_GOURMAND, trait_SAPROPHAGE, trait_SAPROVORE, trait_THRESH_FELINE, trait_THRESH_LUPINE, calendar::turn, consumption_event::type_id, and item::typeId().
Referenced by comestible_inventory_preset::comestible_inventory_preset(), find_auto_consume(), and modify_morale().
| int Character::get_acquirable_energy | ( | const item & | it | ) | const |
Definition at line 1472 of file consumption.cpp.
References get_acquirable_energy(), and get_cbm_rechargeable_with().
| int Character::get_acquirable_energy | ( | const item & | it, |
| rechargeable_cbm | cbm | ||
| ) | const |
Definition at line 1426 of file consumption.cpp.
References item::charges, item::charges_per_volume(), item::count_by_charges(), bionic_data::fuel_capacity, bionic_data::fuel_efficiency, item::fuel_energy(), furnace, furnace_max_volume, get_bionic_fueled_with(), get_most_efficient_bionic(), item::made_of(), none, other, plut_charges, reactor, itype::stack_size, item::type, item::typeId(), item::volume(), itype::volume, item::weight(), and itype::weight.
Referenced by feed_furnace_with(), feed_reactor_with(), and get_acquirable_energy().
Definition at line 1628 of file ranged.cpp.
References _, effective_dispersion(), get_default_aim_type(), item::is_gun(), MAX_RECOIL, and item::sight_dispersion().
Referenced by target_ui::init_window_and_input(), and print_aim().
| std::map< bodypart_id, int > Character::get_all_armor_type | ( | damage_type | dt, |
| const std::map< bodypart_id, std::vector< const item * > > & | clothing_map | ||
| ) | const |
Definition at line 7025 of file character.cpp.
References debugmsg, DT_ACID, DT_BASH, DT_BIOLOGICAL, DT_BULLET, DT_COLD, DT_CUT, DT_ELECTRIC, DT_HEAT, DT_NULL, DT_STAB, DT_TRUE, Creature::get_all_body_parts(), get_armor_bash(), get_armor_bullet(), get_armor_cut(), mutation_armor(), NUM_DT, and cata::hash64_detail::ret.
Referenced by get_armor_fire().
| const SkillLevelMap & Character::get_all_skills | ( | ) | const |
Definition at line 3341 of file character.cpp.
References _skills.
Referenced by player::has_recipe_requirements(), lighting_crafting_speed_multiplier(), set_skills(), and memorial_logger::write().
Returns the items that are ammo and have the matching ammo type.
Definition at line 2584 of file character.cpp.
References item::ammo_type(), and visitable< Character >::items_with().
Referenced by item::color_in_inventory(), and npc::decide_needs().
| int Character::get_armor_acid | ( | bodypart_id | bp | ) | const |
Returns overall acid resistance for the body part.
Definition at line 7156 of file character.cpp.
References DT_ACID, and get_armor_type().
|
overridevirtual |
Returns overall bashing resistance for the body_part.
Reimplemented from Creature.
Definition at line 6971 of file character.cpp.
References Creature::armor_bash_bonus, and get_armor_bash_base().
Referenced by get_all_armor_type(), get_armor_type(), game::get_dangerous_tile(), and game::place_player().
|
overridevirtual |
Returns bashing resistance from the creature and armor only.
Reimplemented from Creature.
Definition at line 7075 of file character.cpp.
References DT_BASH, get_bionics(), int_id< T >::id(), mutation_armor(), cata::hash64_detail::ret, and worn.
Referenced by get_armor_bash().
|
overridevirtual |
Returns overall bullet resistance for the body_part.
Reimplemented from Creature.
Definition at line 6981 of file character.cpp.
References Creature::armor_bullet_bonus, and get_armor_bullet_base().
Referenced by get_all_armor_type(), and get_armor_type().
|
overridevirtual |
Returns cutting resistance from the creature and armor only.
Reimplemented from Creature.
Definition at line 7113 of file character.cpp.
References DT_BULLET, get_bionics(), int_id< T >::id(), mutation_armor(), cata::hash64_detail::ret, and worn.
Referenced by get_armor_bullet().
|
overridevirtual |
Returns overall cutting resistance for the body_part.
Reimplemented from Creature.
Definition at line 6976 of file character.cpp.
References Creature::armor_cut_bonus, and get_armor_cut_base().
Referenced by get_all_armor_type(), get_armor_type(), and map::player_in_field().
|
overridevirtual |
Returns cutting resistance from the creature and armor only.
Reimplemented from Creature.
Definition at line 7094 of file character.cpp.
References DT_CUT, get_bionics(), int_id< T >::id(), mutation_armor(), cata::hash64_detail::ret, and worn.
Referenced by get_armor_cut().
| std::map< bodypart_id, int > Character::get_armor_fire | ( | const std::map< bodypart_id, std::vector< const item * > > & | clothing_map | ) | const |
Returns overall fire resistance.
Definition at line 8386 of file character.cpp.
References DT_HEAT, and get_all_armor_type().
Referenced by update_bodytemp().
|
overridevirtual |
Returns overall resistance to given type on the bod part.
Implements Creature.
Definition at line 6987 of file character.cpp.
References debugmsg, DT_ACID, DT_BASH, DT_BIOLOGICAL, DT_BULLET, DT_COLD, DT_CUT, DT_ELECTRIC, DT_HEAT, DT_NULL, DT_STAB, DT_TRUE, get_armor_bash(), get_armor_bullet(), get_armor_cut(), mutation_armor(), NUM_DT, cata::hash64_detail::ret, and worn.
Referenced by map::burn_body_part(), get_armor_acid(), and is_immune_field().
| std::vector< tripoint > & Character::get_auto_move_route | ( | ) |
Definition at line 10511 of file character.cpp.
References auto_move_route.
Referenced by game::cancel_activity_or_ignore_query(), game::cancel_activity_query(), npc::move(), and npc::move_to().
| std::vector< trait_id > Character::get_base_traits | ( | ) | const |
Get the idents of all base traits.
Definition at line 2852 of file newcharacter.cpp.
References my_traits.
Referenced by avatar::create(), and set_description().
Return bionic_id of bionics able to use it as fuel.
Definition at line 1928 of file character.cpp.
References get_bionics(), and item::typeId().
Referenced by burn_move_stamina(), fuel_bionic_with(), get_acquirable_energy(), game::on_move_effects(), reset_remote_fuel(), and update_fuel_storage().
| std::vector< bionic_id > Character::get_bionics | ( | ) | const |
Definition at line 1868 of file character.cpp.
References b, and my_bionics.
Referenced by absorb_hit(), bionic_armor_bonus(), bionics_weight(), can_fuel_bionic_with(), can_uninstall_bionic(), get_armor_bash_base(), get_armor_bullet_base(), get_armor_cut_base(), get_bionic_fueled_with(), get_env_resist(), get_fuel_capacity(), get_fueled_bionics(), get_mod_stat_from_bionic(), get_remote_fueled_bionic(), get_total_fuel_capacity(), get_used_bionics_slots(), has_any_bionic(), has_bionic(), player::load(), mut_cbm_encumb(), mutation_ok(), suffer(), weight_capacity(), and memorial_logger::write().
| rechargeable_cbm Character::get_cbm_rechargeable_with | ( | const item & | it | ) | const |
Definition at line 1409 of file consumption.cpp.
References can_feed_furnace_with(), can_feed_reactor_with(), can_fuel_bionic_with(), furnace, none, other, and reactor.
Referenced by can_consume_for_bionic(), and get_acquirable_energy().
|
inline |
Definition at line 1930 of file character.h.
References check_encumbrance.
Referenced by player::process_items().
Returns a reference to the item itself (if it's consumable), the first of its contents (if it's consumable) or null item otherwise.
WARNING: consumable does not necessarily guarantee the comestible type.
Definition at line 1502 of file consumption.cpp.
References can_consume_as_is(), item::contents, item_contents::front(), and item::is_container_empty().
Referenced by player::consume_item(), and find_auto_consume().
Returns all items that must be taken off before taking off this item.
Definition at line 2478 of file character.cpp.
References is_worn(), item::is_worn_only_with(), and worn.
Referenced by player::can_takeoff(), and pickup::reorder_for_dropping().
| player_activity Character::get_destination_activity | ( | ) | const |
Definition at line 1028 of file character.cpp.
References destination_activity.
Referenced by has_destination_activity(), has_distant_destination(), and start_destination_activity().
|
virtual |
Definition at line 4068 of file character.cpp.
References dex_bonus, and get_dex_base().
Referenced by aim_speed_dex_modifier(), mattack::bio_op_disarm(), ranged::burst_penalty(), activity_handlers::butcher_finish(), check_mount_is_spooked(), choose_ma_style(), companion_combat_rank(), companion_industry_rank(), companion_survival_rank(), deal_damage(), dex_string(), player::disarm(), draw_stat_narrow(), draw_stat_wide(), draw_stats(), draw_stats_tab(), item::effective_dps(), enumerate_unmet_requirements(), iexamine::gaspump(), effect_scaling::get(), get_dodge_base(), get_hit_base(), npc::get_pathfinding_settings(), get_speed(), mattack::grab(), player::gunmod_installation_odds(), hardcoded_mutation_attack(), meets_stat_requirements(), iuse::mind_splicer(), move_effects(), npc::move_to(), mutation_attacks(), character_martial_arts::pick_style(), vehicle::pldrive(), game::process_artifact(), ranged_dex_mod(), player::stability_roll(), and avatar::steal().
|
virtual |
Reimplemented in avatar.
Definition at line 4085 of file character.cpp.
References dex_max.
Referenced by enchantment::activate_passive(), draw_stats_tab(), get_dex(), and avatar::get_dex_base().
|
virtual |
|
overridevirtual |
Reimplemented from Creature.
Definition at line 812 of file melee.cpp.
References dodges_left, effect_beartrap, effect_bouldering, effect_grabbed, effect_grabbing, effect_heavysnare, effect_lightsnare, effect_narcosis, g, Creature::get_dodge(), Creature::has_effect(), has_trait(), in_sleep_state(), pos(), cata::hash64_detail::ret, trait_PROF_SKATER, and worn_with_flag().
Referenced by npc::character_danger(), trapfunc::crossbow(), player::dodge_roll(), draw_skills_tab(), forced_dismount(), trapfunc::pit(), trapfunc::pit_glass(), trapfunc::pit_spikes(), mattack::science(), trapfunc::shotgun(), and game::update_stair_monsters().
|
overridevirtual |
Combat getters.
Dexterity increases dodge base Dodge increases dodge_baseImplements Creature.
Definition at line 5836 of file character.cpp.
References get_dex(), get_skill_level(), and skill_dodge.
| float Character::get_effective_efficiency | ( | int | b, |
| float | fuel_efficiency | ||
| ) |
Applies modifier to fuel_efficiency and returns the resulting efficiency.
Definition at line 1474 of file bionics.cpp.
References b, bionic_data::coverage_power_gen_penalty, flag_ALLOWS_NATURAL_ATTACKS(), flag_AURA(), flag_PERSONAL(), flag_SEMITANGIBLE(), bionic::info(), bionic_data::occupied_bodyparts, cata::optional< T >::value(), and worn.
Referenced by burn_fuel(), and passive_power_gen().
| char_encumbrance_data Character::get_encumbrance | ( | ) | const |
Get encumbrance for all body parts.
Definition at line 3680 of file character.cpp.
References encumbrance_cache.
Referenced by item::on_wear(), character_display::print_encumbrance(), and should_combine_bps().
| char_encumbrance_data Character::get_encumbrance | ( | const item & | new_item | ) | const |
Get encumbrance for all body parts as if new_item was also worn.
Definition at line 3685 of file character.cpp.
References calc_encumbrance().
|
overridevirtual |
Returns overall env_resist on a body_part.
Reimplemented from Creature.
Definition at line 7133 of file character.cpp.
References bp_head, get_bionics(), has_active_bionic(), has_trait(), int_id< T >::id(), cata::hash64_detail::ret, trait_SEESLEEP, and worn.
Referenced by iexamine::flower_poppy(), is_immune_field(), and map::player_in_field().
|
inlinevirtual |
Reimplemented in avatar, and npc.
Definition at line 348 of file character.h.
Referenced by complete_craft(), npc::consume_food_from_camp(), basecamp::faction_display(), vehicle::handle_potential_theft(), and npc::has_faction_relationship().
| std::pair< int, int > Character::get_fastest_sight | ( | const item & | gun, |
| double | recoil | ||
| ) | const |
Definition at line 577 of file character.cpp.
References effective_dispersion(), flag_DISABLE_SIGHTS(), itype::gun, item::gunmods(), item::has_flag(), recoil, and item::type.
Referenced by aim_per_move().
| int Character::get_fatigue | ( | ) | const |
Definition at line 4455 of file character.cpp.
References fatigue.
Referenced by npc::address_needs(), player::calc_focus_equilibrium(), spell::can_cast(), can_use_mutation(), debug_menu::character_edit_menu(), check_and_recover_morale(), check_needs_extremes(), npc::complain(), avatar::disp_morale(), get_fatigue_description(), iuse::hand_crank(), activity_handlers::hand_crank_do_turn(), player::hardcoded_effects(), known_magic::has_enough_energy(), mend(), player::power_mutations_ui(), player::process_one_effect(), conditional_t< T >::set_need(), player::sleep_spot(), suffer_mutation_power(), update_needs(), iuse::vibe(), and activity_handlers::vibe_do_turn().
| std::pair< std::string, nc_color > Character::get_fatigue_description | ( | ) | const |
Definition at line 4396 of file character.cpp.
References _, c_light_red, c_red, c_white, c_yellow, dead_tired, exhausted, fatigue, get_fatigue(), and tired.
Referenced by draw_health_classic(), draw_needs_compact(), draw_needs_labels(), draw_needs_narrow(), spell::energy_cur_string(), npc::faction_display(), and get_consume_needs_hint().
| int Character::get_free_bionics_slots | ( | const bodypart_id & | bp | ) | const |
Definition at line 2518 of file bionics.cpp.
References get_total_bionics_slots(), and get_used_bionics_slots().
Referenced by bionic_installation_issues(), and player::power_bionics().
Return list of available fuel for this bionic.
Definition at line 2076 of file character.cpp.
References flag_PERPETUAL(), bionic_data::fuel_opts, Creature::get_value(), item::has_flag(), and string_id< T >::str().
Referenced by burn_fuel(), draw_bionics_titlebar(), passive_power_gen(), process_bionic(), and npc::recharge_cbm().
| int Character::get_fuel_capacity | ( | const itype_id & | fuel | ) | const |
Return available space to store specified fuel.
Definition at line 2088 of file character.cpp.
References get_bionics(), Creature::get_value(), and string_id< T >::str().
Referenced by fuel_bionic_with().
| std::vector< bionic_id > Character::get_fueled_bionics | ( | ) | const |
Return bionic_id of fueled bionics.
Definition at line 1943 of file character.cpp.
References get_bionics().
Referenced by npc::recharge_cbm(), and npc::wants_to_recharge_cbm().
|
overridevirtual |
Reimplemented from Creature.
Definition at line 6100 of file character.cpp.
References male.
Referenced by translate_gendered_line().
|
virtual |
Getters for health values exclusive to characters.
Definition at line 4141 of file character.cpp.
References healthy.
Referenced by debug_menu::character_edit_menu(), eff_fun_fungus(), eff_fun_spores(), expose_to_disease(), player::hardcoded_effects(), healing_rate(), healing_rate_medicine(), mend(), print_health(), player::process_one_effect(), and update_health().
|
virtual |
Definition at line 4145 of file character.cpp.
References healthy_mod.
Referenced by debug_menu::character_edit_menu(), player::process_one_effect(), suffer_from_radiation(), update_health(), and vomit().
| std::string Character::get_highest_category | ( | ) | const |
Returns the highest mutation category.
Returns the mutation category with the highest strength.
Definition at line 7970 of file character.cpp.
References mutation_category_level.
Referenced by player::hardcoded_effects(), old_mutate(), map::player_in_field(), and test_crossing_threshold().
|
overridevirtual |
Implements Creature.
Definition at line 5842 of file character.cpp.
References get_dex().
Referenced by get_melee_hit_base().
| float Character::get_hit_weapon | ( | const item & | weap | ) | const |
Gets melee accuracy component from weapon+skills.
Unarmed improves hit chance for unarmed weapons Bashing improves hit chance for bashing weapons Cutting improves hit chance for cutting weapons Stabbing improves hit chance for piercing weapons Melee improves hit chance for all items (including non-weapons)Definition at line 274 of file melee.cpp.
References bio_cqb, BIO_CQB_LEVEL, get_skill_level(), has_active_bionic(), itype::m_to_hit, item::melee_skill(), skill_melee, and item::type.
Referenced by item::effective_dps(), and get_melee_hit_base().
| std::vector< Creature * > Character::get_hostile_creatures | ( | int | range | ) | const |
Get all hostile creatures currently visible to this player.
Definition at line 10230 of file character.cpp.
References Creature::A_HOSTILE, Creature::attitude_to(), g, Creature::pos(), pos(), rl_dist_exact(), and sees().
| std::pair< std::string, nc_color > Character::get_hunger_description | ( | ) | const |
Definition at line 4361 of file character.cpp.
References _, bmr(), c_green, c_light_red, c_red, c_white, c_yellow, stomach_contents::get_calories(), has_trait(), max_stored_kcal(), stomach, stored_calories, string_format(), and trait_SELFAWARE.
Referenced by draw_health_classic(), draw_needs_compact(), draw_needs_labels(), draw_needs_narrow(), npc::faction_display(), and get_consume_needs_hint().
|
virtual |
Definition at line 4076 of file character.cpp.
References get_int_base(), and int_bonus.
Referenced by adjust_for_focus(), choose_ma_style(), companion_combat_rank(), companion_industry_rank(), companion_survival_rank(), complete_craft(), avatar::do_read(), draw_stat_narrow(), draw_stat_wide(), draw_stats(), draw_stats_info(), draw_stats_tab(), enumerate_unmet_requirements(), spell::exp_modifier(), npc::finish_read(), effect_scaling::get(), player::gunmod_installation_odds(), player::hardcoded_effects(), int_string(), known_magic::max_mana(), meets_stat_requirements(), perform_technique(), character_martial_arts::pick_style(), game::process_artifact(), avatar::read(), read_speed(), rust_rate(), set_stats(), spell::spell_fail(), player::talk_skill(), known_magic::time_to_learn_spell(), npc::time_to_read(), avatar::time_to_read(), and weed_msg().
|
virtual |
Reimplemented in avatar.
Definition at line 4093 of file character.cpp.
References int_max.
Referenced by enchantment::activate_passive(), draw_stats_tab(), get_int(), and avatar::get_int_base().
|
virtual |
| int Character::get_item_position | ( | const item * | it | ) | const |
Returns the item position (suitable for i_at or similar) of a specific item.
Returns INT_MIN if the item is not found. Note that this may lose some information, for example the returned position is the same when the given item points to the container and when it points to the item inside the container. All items that are part of the same stack have the same item position.
Definition at line 2407 of file character.cpp.
References visitable< T >::has_item(), inv, inventory::position_by_item(), weapon, worn, and worn_position_to_index().
Referenced by npc::alt_attack(), game::butcher(), iuse::chop_logs(), iuse::chop_tree(), chop_tree_activity(), convert_to_items(), damage_item(), iuse::fill_pit(), find_best_lock_picking_tool(), find_best_prying_tool(), iuse::hacksaw(), iuse::makemound(), item_location::impl::item_on_person::obtain(), iuse::pack_item(), iuse::play_game(), iuse::radglove(), iuse::stimpack(), salvage_actor::try_to_cut_up(), pick_lock_actor::use(), musical_instrument_actor::use(), repair_item_actor::use(), sew_advanced_actor::use(), and avatar_action::wield().
| float Character::get_kcal_percent | ( | ) | const |
Definition at line 4322 of file character.cpp.
References get_stored_kcal(), and max_stored_kcal().
Referenced by can_use_mutation(), check_needs_extremes(), npc::complain(), player_activity::do_turn(), draw_speed_tab(), iexamine::harvest_plant(), is_hibernating(), behavior::character_oracle_t::needs_food_badly(), player::power_mutations_ui(), npc::process_turn(), player::recalc_speed_bonus(), player::reset_stats(), sleep(), and suffer_while_awake().
| const recipe_subset & Character::get_learned_recipes | ( | ) | const |
Returns all known recipes.
Definition at line 10559 of file character.cpp.
References _skills, recipe_dictionary::all_autolearn(), autolearn_skills_stamp, learned_recipes, meets_skill_requirements(), and recipe_dict.
Referenced by player::get_available_recipes(), knows_recipe(), peek_related_recipe(), and select_crafting_recipe().
| int Character::get_lowest_hp | ( | ) | const |
Definition at line 10353 of file character.cpp.
References Creature::get_body().
Referenced by debug_menu::character_edit_menu().
| int Character::get_max_healthy | ( | ) | const |
Definition at line 4543 of file character.cpp.
Referenced by update_health().
| units::energy Character::get_max_power_level | ( | ) | const |
Definition at line 1972 of file character.cpp.
References max_power_level.
Referenced by amount_of_storage_bionics(), bionics_install_failure(), burn_fuel(), install_bionic_actor::can_use(), npc::can_use_offensive_cbm(), npc::check_or_use_weapon_cbm(), avatar::create(), draw_bionics_tab(), draw_bionics_titlebar(), feed_furnace_with(), bionic_install_preset::get_denial(), mod_power_level(), game::phasing_move(), power_stat(), process_bionic(), player::process_turn(), npc::recharge_cbm(), suffer_from_bad_bionics(), npc::wants_to_recharge_cbm(), and memorial_logger::write().
| float Character::get_melee_hit_base | ( | ) | const |
Returns weapon skill.
Definition at line 291 of file melee.cpp.
References get_hit_base(), get_hit_weapon(), mabuff_tohit_bonus(), and used_weapon().
Referenced by draw_stats_info(), hit_roll(), and set_stats().
| std::string Character::get_miss_reason | ( | ) |
Returns an explanation for why the player would miss a melee attack.
Definition at line 329 of file melee.cpp.
References _, add_miss_reason(), bp_torso, effect_contacts, encumb(), Creature::has_effect(), has_trait(), melee_miss_reasons, roll_remainder(), trait_HYPEROPIC, and worn_with_flag().
Referenced by melee_attack().
|
private |
Retrieves a stat mod of a mutation.
Definition at line 195 of file mutation.cpp.
References arg(), mutation_branch::mods, and cata::hash64_detail::ret.
Referenced by apply_mods().
| int Character::get_mod_stat_from_bionic | ( | const character_stat & | Stat | ) | const |
Get stat bonus from bionic.
Definition at line 2169 of file character.cpp.
References get_bionics(), and cata::hash64_detail::ret.
Referenced by reset_stats().
| int Character::get_morale | ( | const morale_type & | type | ) | const |
| int Character::get_morale_level | ( | ) | const |
Definition at line 9086 of file character.cpp.
References morale.
Referenced by player::calc_focus_equilibrium(), debug_menu::character_edit_menu(), has_morale_to_craft(), has_morale_to_read(), morale_crafting_speed_multiplier(), morale_stat(), player::reset_stats(), and enzlave_actor::use().
| int Character::get_most_accurate_sight | ( | const item & | gun | ) | const |
Definition at line 601 of file character.cpp.
References effective_dispersion(), itype::gun, item::gunmods(), item::is_gun(), and item::type.
Referenced by npc::invalidate_range_cache(), and npc::method_of_attack().
Return bionic_id of bionic of most fuel efficient bionic.
Definition at line 1954 of file character.cpp.
Referenced by fuel_bionic_with(), and get_acquirable_energy().
| character_movemode Character::get_movement_mode | ( | ) | const |
Definition at line 1614 of file character.cpp.
References move_mode.
Referenced by cata_event_dispatch::avatar_moves().
| social_modifiers Character::get_mutation_social_mods | ( | ) | const |
Goes over all mutations, returning the sum of the social modifiers.
Definition at line 6668 of file character.cpp.
References cached_mutations.
Referenced by talk_trial::calc_chance().
| std::vector< trait_id > Character::get_mutations | ( | bool | include_hidden = true | ) | const |
Get the idents of all traits/mutations.
Definition at line 2857 of file newcharacter.cpp.
References enchantment_cache, and my_mutations.
Referenced by monster::attitude(), bodytemp_modifier_traits(), bodytemp_modifier_traits_floor(), can_eat(), can_install_cbm_on_bp(), can_use_heal_item(), can_wear(), check_and_recover_morale(), compute_default_effective_vitamins(), player::crafting_success_roll(), avatar::create(), crossed_threshold(), character_display::disp_info(), drench_mut_calc(), npc::form_opinion(), has_trait_flag(), is_category_allowed(), is_weak_to_water(), mod_healthy(), mut_cbm_encumb(), mutation_armor(), mutation_attacks(), item::mutations_from_wearing(), player::process_turn(), avatar::randomize(), reset_scenario(), roll_bash_damage(), roll_cut_damage(), roll_stab_damage(), set_description(), set_highest_cat_level(), set_profession(), sleep(), update_type_of_scent(), visible_mutations(), vitamin_rate(), and memorial_logger::write().
|
overridevirtual |
Implements Creature.
Definition at line 6095 of file character.cpp.
References name.
Referenced by autodoc_internal(), debug_menu::character_edit_menu(), npc::die(), pour_into(), npc::set_omt_destination(), and game::vertical_move().
| action_id Character::get_next_auto_move_direction | ( | ) |
Definition at line 10516 of file character.cpp.
References ACTION_NULL, auto_move_route, get_movement_action_from_delta(), has_destination(), next_expected_position, pos(), tripoint::x, tripoint::y, yes, and tripoint::z.
Referenced by game::handle_action(), and game::try_get_left_click_action().
| std::vector< std::string > Character::get_overlay_ids | ( | ) | const |
Returns a list of the IDs of overlays on this character, sorted from "lowest" to "highest".
Only required for rendering.
Definition at line 3291 of file character.cpp.
References CMM_WALK, Creature::effects, io::enum_to_string(), get_overlay_order_of_mutation(), is_armed(), move_mode, my_bionics, my_mutations, string_id< T >::str(), item::typeId(), weapon, and worn.
|
overridevirtual |
Reimplemented from Creature.
Definition at line 4465 of file character.cpp.
References _, c_light_red, c_red, effect_got_checked, Creature::get_pain_description(), Creature::get_perceived_pain(), Creature::has_effect(), has_trait(), Creature::pain, string_format(), and trait_SELFAWARE.
Referenced by draw_health_classic(), draw_needs_compact(), draw_needs_labels(), draw_needs_narrow(), and get_consume_needs_hint().
| int Character::get_painkiller | ( | ) | const |
Returns intensity of painkillers
Definition at line 9804 of file character.cpp.
References pkill.
Referenced by addict_effect(), apply_damage(), check_and_recover_morale(), check_needs_extremes(), npc::form_opinion(), player::get_perceived_pain(), process_bionic(), player::process_one_effect(), player::reset_stats(), iuse::smoking(), suffer_from_stimulants(), update_needs(), and iuse::weed_cake().
|
overridevirtual |
Returns a set of points we do not want to path through.
Implements Creature.
Reimplemented in npc.
Definition at line 9946 of file character.cpp.
References g, cata::hash64_detail::ret, and sees().
Referenced by activity_on_turn_move_loot(), can_mount(), game::handle_action(), game::list_items(), game::look_around(), perform_zone_activity_turn(), route_adjacent(), activity_handlers::travel_do_turn(), and game::try_get_left_click_action().
|
overridevirtual |
Returns settings for pathfinding.
Implements Creature.
Reimplemented in npc.
Definition at line 9960 of file character.cpp.
References path_settings.
Referenced by activity_on_turn_move_loot(), can_mount(), game::handle_action(), game::list_items(), game::look_around(), perform_zone_activity_turn(), route_adjacent(), activity_handlers::travel_do_turn(), and game::try_get_left_click_action().
|
virtual |
Definition at line 4072 of file character.cpp.
References get_per_base(), and per_bonus.
Referenced by mattack::bio_op_disarm(), check_needs_extremes(), choose_ma_style(), companion_combat_rank(), companion_industry_rank(), companion_survival_rank(), player::disarm(), draw_stat_narrow(), draw_stat_wide(), draw_stats(), draw_stats_info(), draw_stats_tab(), enumerate_unmet_requirements(), effect_scaling::get(), meets_stat_requirements(), overmap_sight_range(), per_string(), character_martial_arts::pick_style(), vehicle::pldrive(), game::process_artifact(), ranged_per_mod(), recalc_sight_limits(), iexamine::safe(), player::stability_roll(), avatar::steal(), and player::talk_skill().
|
virtual |
Reimplemented in avatar.
Definition at line 4089 of file character.cpp.
References per_max.
Referenced by enchantment::activate_passive(), draw_stats_tab(), get_per(), and avatar::get_per_base().
|
virtual |
| units::energy Character::get_power_level | ( | ) | const |
Definition at line 1967 of file character.cpp.
References power_level.
Referenced by activate_bionic(), attempt_recharge(), burn_fuel(), spell::can_cast(), npc::can_use_offensive_cbm(), npc::check_or_use_weapon_cbm(), comestible_inventory_preset::comestible_inventory_preset(), crafting_inventory(), deactivate_bionic(), do_skill_rust(), draw_bionics_tab(), draw_bionics_titlebar(), iuse::ehandcuffs(), explosion_handler::emp_blast(), spell::energy_cur_string(), feed_furnace_with(), ranged::gunmode_checks_weapon(), hack_attempt(), has_charges(), known_magic::has_enough_energy(), has_fire(), known_magic::max_mana(), melee_special_effects(), mod_power_level(), modify_morale(), game::monmove(), player::on_hit(), iexamine::pay_gas(), game::phasing_move(), power_stat(), process_bionic(), player::process_items(), mattack::riotbot(), suffer_from_asthma(), suffer_from_bad_bionics(), suffer_while_underwater(), try_start_hacking(), player::uncanny_dodge(), update_stamina(), use_charges(), use_fire(), npc::wants_to_recharge_cbm(), and memorial_logger::write().
| int Character::get_rad | ( | ) | const |
Definition at line 7176 of file character.cpp.
References radiation.
Referenced by activate_bionic(), iexamine::autodoc(), debug_menu::character_edit_menu(), check_art_charge_req(), npc::complain(), iuse::geiger(), mend(), mod_rad(), game::process_artifact(), player::process_one_effect(), iuse::radglove(), regen(), player::reset_stats(), suffer_from_radiation(), and update_body().
| bionic_id Character::get_remote_fueled_bionic | ( | ) | const |
Returns bionic_id of first remote fueled bionic found.
Definition at line 1902 of file character.cpp.
References bionic_id, and get_bionics().
Referenced by iuse::cable_attach(), and iuse::solarpack().
| int Character::get_shout_volume | ( | ) | const |
Definition at line 7686 of file character.cpp.
References bp_mouth, encumb(), has_trait(), is_wearing(), itype_id, noise, str_cur, trait_PROF_FOODP, trait_SHOUT2, trait_SHOUT3, and Creature::underwater.
Referenced by npc::say(), shout(), and activity_handlers::spellcasting_finish().
|
overridevirtual |
Get size class of character.
Implements Creature.
Definition at line 541 of file character.cpp.
References size_class.
Referenced by can_mount(), repair_item_actor::can_repair_target(), Creature::deal_melee_hit(), Creature::deal_projectile_attack(), repair_item_actor::default_action(), player::fire_gun(), item::get_sizing(), player::get_weapon_dispersion(), ranged::gunmode_checks_weapon(), height(), avatar_action::move(), power_rating(), player::process_one_effect(), Creature::sees(), update_needs(), game::walk_move(), and wear_item().
| int Character::get_skill_level | ( | const skill_id & | ident | ) | const |
Definition at line 3356 of file character.cpp.
References _skills.
Referenced by npc::address_needs(), aim_speed_skill_modifier(), apply_skill_boost(), iexamine::arcfurnace_empty(), attack_cost(), player::avoid_trap(), mattack::bio_op_disarm(), bionics_pl_skill(), block_hit(), ranged::burst_penalty(), activity_handlers::butcher_finish(), calc_skill_training_time(), veh_utils::calc_xp_gain(), character_martial_arts::can_arm_block(), player::can_autolearn(), can_estimate_rot(), character_martial_arts::can_leg_block(), can_mount(), npc::can_read(), enzlave_actor::can_use(), caravan_price(), activity_handlers::chop_planks_finish(), item::color_in_inventory(), companion_combat_rank(), companion_industry_rank(), companion_survival_rank(), complete_craft(), crafting::complete_disassemble(), construction_color(), player::crafting_success_roll(), crit_chance(), iuse::crowbar(), salvage_actor::cut_up(), mattack::dermatik(), trap::detect_trap(), player::disarm(), avatar::do_read(), dialogue::dynamic_line(), iuse::einktabletpc(), enumerate_unmet_requirements(), spell::exp_modifier(), map_data_common_t::extended_description(), npc::faction_display(), player::fall_damage_mod(), farm_action(), game::find_or_make_stairs(), npc::finish_read(), activity_handlers::fish_do_turn(), iuse::fish_trap(), fungal_effects::fungalize(), player::get_available_recipes(), item::get_available_recipes(), heal_actor::get_bandaged_level(), avatar::get_book_reader(), heal_actor::get_disinfected_level(), get_dodge_base(), get_encumbrance_description(), heal_actor::get_heal_value(), get_hit_weapon(), player::get_melee(), player_activity::get_progress_message(), player::get_weapon_dispersion(), iuse::gun_repair(), player::gun_value(), player::gunmod_installation_odds(), computer_session::hack_attempt(), hack_level(), hackveh(), handle_melee_wear(), hardcoded_mutation_attack(), harvest_common(), iexamine::harvest_plant(), has_skill_for_vehicle_work(), ma_requirements::is_valid_character(), player::item_reload_cost(), item_store_cost(), ma_style_callback::key(), iexamine::kiln_empty(), activity_handlers::lockpicking_finish(), melee_attack(), player::mend_item(), iuse::mind_splicer(), morale_crafting_speed_multiplier(), iuse::multicooker(), mutation_attacks(), npc_trading::net_price_adjustment(), game::npc_menu(), player::on_dodge(), item::on_wield(), iuse::pack_cbm(), pick_part_to_heal(), pick_plant(), vehicle::pldrive(), player::practice(), iexamine::practice_survival_while_foraging(), mattack::pull_metal_weapon(), activity_handlers::pulp_do_turn(), avatar::randomize(), examine_item_menu::rate_action_use(), player::reach_attack(), avatar::read(), recalc_hp(), repair_item_actor::repair(), repair_item_actor::repair_chance(), activity_handlers::repair_item_finish(), activity_handlers::robot_control_finish(), iuse::robotcontrol(), roll_bash_damage(), roll_cut_damage(), roll_stab_damage(), iexamine::safe(), scavenging_combat_skill(), set_description(), conditional_t< T >::set_has_skill(), set_skills(), map::shake_vehicle(), iexamine::shrub_wildveggies(), sinkhole_safety_roll(), skill_increment_cost(), npc::skills_offered_to(), smash(), read_inventory_preset::sort_compare(), spell::spell_fail(), player::start_craft(), talk_function::start_training(), suffer_from_schizophrenia(), survive_random_encounter(), swim_speed(), player::talk_skill(), iuse::tazer(), player::throw_item(), throw_range(), mattack::thrown_by_judo(), time_to_attack(), known_magic::time_to_learn_spell(), npc::time_to_read(), avatar::time_to_read(), activity_handlers::train_finish(), iexamine::tree_hickory(), place_monster_iuse::use(), firestarter_actor::use(), enzlave_actor::use(), heal_actor::use(), sew_advanced_actor::use(), npc::value(), game::vertical_move(), player::wield_contents(), and debug_menu::wishskill().
Definition at line 3361 of file character.cpp.
References _skills.
| SkillLevel & Character::get_skill_level_object | ( | const skill_id & | ident | ) |
Definition at line 3351 of file character.cpp.
References _skills.
Referenced by player::calc_focus_equilibrium(), item::color_in_inventory(), avatar::do_read(), draw_skills_tab(), npc::finish_read(), player_activity::get_progress_message(), handle_player_display_action(), player::handle_skill_warning(), player::practice(), read_inventory_preset::read_inventory_preset(), set_skill_level(), skim_book_msg(), activity_handlers::train_finish(), and debug_menu::wishskill().
| const SkillLevel & Character::get_skill_level_object | ( | const skill_id & | ident | ) | const |
Definition at line 3346 of file character.cpp.
References _skills.
| int Character::get_sleep_deprivation | ( | ) | const |
Definition at line 4460 of file character.cpp.
References sleep_deprivation.
Referenced by debug_menu::character_edit_menu(), check_needs_extremes(), player::hardcoded_effects(), player::reset_stats(), and suffer().
|
overridevirtual |
Reimplemented from Creature.
Definition at line 4124 of file character.cpp.
References get_dex(), Creature::get_speed(), and get_speedydex_bonus().
Referenced by npc::assess_danger(), npc::character_danger(), craft_progress_message(), draw_char_narrow(), draw_char_wide(), draw_health_classic(), draw_speed_tab(), draw_stealth(), npc::enough_time_to_reload(), vehicle::pldrive(), player::recalc_speed_bonus(), speed_description(), speed_rating(), npc::speed_rating(), and musical_instrument_actor::use().
| int Character::get_stamina | ( | ) | const |
Definition at line 7194 of file character.cpp.
References stamina.
Referenced by iuse::artifact(), attack_cost(), block_hit(), burn_move_stamina(), spell::can_cast(), can_run(), debug_menu::character_edit_menu(), cough(), player_activity::do_turn(), draw_char_narrow(), draw_char_wide(), draw_health_classic(), draw_limb2(), spell::energy_cur_string(), known_magic::has_enough_energy(), aim_activity_actor::load_RAS_weapon(), player::on_dodge(), on_item_takeoff(), on_item_wear(), perform_technique(), player::process_one_effect(), npc::process_turn(), activity_handlers::pulp_do_turn(), avatar::read(), activity_handlers::read_do_turn(), speed_rating(), stamina_move_cost_modifier(), update_stamina(), activity_handlers::wait_stamina_do_turn(), and activity_handlers::wait_stamina_finish().
| int Character::get_stamina_max | ( | ) | const |
Definition at line 7199 of file character.cpp.
References mutation_value().
Referenced by attack_cost(), block_hit(), can_run(), debug_menu::character_edit_menu(), cough(), player_activity::do_turn(), draw_char_narrow(), draw_char_wide(), draw_health_classic(), draw_limb2(), spell::energy_cost_string(), spell::energy_cur_string(), aim_activity_actor::load_RAS_weapon(), mod_stamina(), player::normalize(), player::on_dodge(), on_item_takeoff(), on_item_wear(), npc::process_turn(), activity_handlers::pulp_do_turn(), avatar::read(), speed_rating(), stamina_move_cost_modifier(), game::start_game(), iuse::stimpack(), update_stamina(), activity_handlers::wait_stamina_do_turn(), and activity_handlers::wait_stamina_finish().
| player_activity Character::get_stashed_activity | ( | ) | const |
Definition at line 973 of file character.cpp.
References stashed_outbounds_activity.
Referenced by npc::move().
| int Character::get_stim | ( | ) | const |
Definition at line 7161 of file character.cpp.
References stim.
Referenced by addict_effect(), check_needs_extremes(), trap::detect_trap(), npc::form_opinion(), player::hardcoded_effects(), player::intimidation(), modify_stimulation(), iuse::oxygen_bottle(), process_bionic(), player::process_one_effect(), player::reset_stats(), player::sleep_spot(), suffer(), update_needs(), and update_stamina().
| int Character::get_stored_kcal | ( | ) | const |
Getter for need values exclusive to characters.
Definition at line 4294 of file character.cpp.
References stored_calories.
Referenced by npc::address_needs(), burn_fuel(), can_drink_nectar(), debug_menu::character_edit_menu(), check_and_recover_morale(), check_needs_extremes(), consume_effects(), npc::consume_food(), npc::consume_food_from_camp(), debug_menu::debug(), npc::decide_needs(), avatar_action::eat_here(), eff_fun_bloated(), fall_asleep(), get_kcal_percent(), player::hardcoded_effects(), mend(), process_bionic(), player::process_one_effect(), npc::process_turn(), conditional_t< T >::set_need(), suffer_while_awake(), npc::value(), and will_eat().
|
virtual |
Getters for stats exclusive to characters.
Definition at line 4064 of file character.cpp.
References get_str_base(), and str_bonus.
Referenced by mattack::bio_op_disarm(), bonus_damage(), ranged::burst_penalty(), player::can_lift(), check_mount_is_spooked(), choose_ma_style(), companion_combat_rank(), companion_industry_rank(), companion_survival_rank(), player::disarm(), draw_stat_narrow(), draw_stat_wide(), draw_stats(), draw_stats_tab(), enumerate_unmet_requirements(), effect_scaling::get(), ranged::get_str_draw_penalty(), game::grabbed_furn_move(), game::grabbed_veh_move(), hardcoded_mutation_attack(), player::intimidation(), player::item_reload_cost(), iexamine::ledge(), meets_stat_requirements(), move_effects(), mutation_attacks(), character_martial_arts::pick_style(), start_location::place_player(), game::process_artifact(), roll_bash_damage(), player::stability_roll(), ranged::str_draw_damage_modifier(), ranged::str_draw_dispersion_modifier(), ranged::str_draw_range_modifier(), str_string(), player::throw_item(), and weight_capacity().
|
virtual |
Reimplemented in avatar.
Definition at line 4081 of file character.cpp.
References str_max.
Referenced by enchantment::activate_passive(), draw_stats_tab(), get_str(), and avatar::get_str_base().
|
virtual |
| int Character::get_thirst | ( | ) | const |
Definition at line 4327 of file character.cpp.
References thirst.
Referenced by npc::address_needs(), can_use_mutation(), debug_menu::character_edit_menu(), check_and_recover_morale(), check_needs_extremes(), npc::complain(), consume_effects(), npc::consume_food(), npc::consume_food_from_camp(), debug_menu::debug(), npc::decide_needs(), player_activity::do_turn(), draw_speed_tab(), eff_fun_bloated(), fall_asleep(), get_thirst_description(), player::hardcoded_effects(), iexamine::harvest_plant(), is_hibernating(), mend(), behavior::character_oracle_t::needs_water_badly(), player::power_mutations_ui(), process_bionic(), player::process_one_effect(), npc::process_turn(), player::recalc_speed_bonus(), player::reset_stats(), rooted(), conditional_t< T >::set_need(), suffer_from_other_mutations(), suffer_mutation_power(), suffer_while_underwater(), npc::value(), vomit(), and will_eat().
| std::pair< std::string, nc_color > Character::get_thirst_description | ( | ) | const |
Definition at line 4332 of file character.cpp.
References _, c_green, c_light_red, c_white, c_yellow, dehydrated, get_thirst(), hydrated, parched, slaked, thirst, thirsty, turgid, and very_thirsty.
Referenced by draw_health_classic(), draw_needs_compact(), draw_needs_labels(), draw_needs_narrow(), npc::faction_display(), and get_consume_needs_hint().
|
inline |
return the calendar::turn the character expired
Definition at line 1408 of file character.h.
References time_died.
| int Character::get_total_bionics_slots | ( | const bodypart_id & | bp | ) | const |
Definition at line 2513 of file bionics.cpp.
Referenced by get_free_bionics_slots(), and player::power_bionics().
| int Character::get_total_fuel_capacity | ( | const itype_id & | fuel | ) | const |
Return total space to store specified fuel.
Definition at line 2107 of file character.cpp.
References get_bionics(), Creature::get_value(), and string_id< T >::str().
Referenced by draw_bionics_titlebar().
| scenttype_id Character::get_type_of_scent | ( | ) | const |
Definition at line 8759 of file character.cpp.
References type_of_scent.
Referenced by game::do_turn(), update_type_of_scent(), and change_scent_iuse::use().
| int Character::get_used_bionics_slots | ( | const bodypart_id & | bp | ) | const |
Definition at line 2485 of file bionics.cpp.
References get_bionics(), int_id< T >::id(), and overmap_ui::search().
Referenced by get_free_bionics_slots().
| std::vector< Creature * > Character::get_visible_creatures | ( | int | range | ) | const |
Returns all creatures that this player can see and that are in the given range.
This player object itself is never included. The player character (g->u) is checked and might be included (if applicable).
| range | The maximal distance (rl_dist), creatures at this distance or less are included. |
Definition at line 10222 of file character.cpp.
References g, Creature::pos(), pos(), rl_dist(), and sees().
Referenced by game::is_hostile_within(), game::list_items_monsters(), and game::mon_info_update().
|
inline |
Definition at line 1491 of file character.h.
References vision_mode_cache.
| float Character::get_vision_threshold | ( | float | light_level | ) | const |
Returns the apparent light level at which the player can see.
This is adjusted by the light level at the character's position to simulate glare, etc, night vision only works if you are in the dark.
Definition at line 1809 of file character.cpp.
References DEBUG_NIGHTVISION, LIGHT_AMBIENT_LIT, LIGHT_AMBIENT_LOW, LIGHT_AMBIENT_MINIMAL, nv_range, vision::threshold_for_nv_range(), and vision_mode_cache.
Referenced by sight_range().
|
overridevirtual |
Returns body weight plus weight of inventory and worn/wielded items.
Implements Creature.
Definition at line 3664 of file character.cpp.
References bionics_weight(), bodyweight(), inv, cata::hash64_detail::ret, weapon, inventory::weight(), item::weight(), and worn.
Referenced by vehicle::calc_mass_center(), can_mount(), npc::move_to(), swim_speed(), weigh_self_actor::use(), and game::walk_move().
| std::string Character::get_weight_string | ( | ) | const |
Definition at line 4536 of file character.cpp.
References bodyweight(), convert_weight(), to_string(), and weight_units().
| int Character::get_working_arm_count | ( | ) | const |
Returns the number of functioning arms.
Definition at line 1287 of file character.cpp.
References has_active_mutation(), is_limb_disabled(), and trait_SHELL2.
Referenced by player::can_wield(), has_two_arms(), melee_attack(), avatar_action::plthrow(), and vehicle::start_engine().
| int Character::get_working_leg_count | ( | ) | const |
Returns the number of functioning legs.
Definition at line 1305 of file character.cpp.
References is_limb_broken().
Referenced by best_shield(), character_martial_arts::can_leg_block(), can_run(), is_on_ground(), and avatar::set_movement_mode().
| character_id Character::getID | ( | ) | const |
Definition at line 477 of file character.cpp.
References id.
Referenced by add_addiction(), item::already_used_by_player(), talk_effect_t::apply(), apply_damage(), iuse::artifact(), mission::assign(), talk_function::assign_camp(), vehicle::assign_seat(), best_installer(), bionics_install_failure(), map::board_vehicle(), veh_interact::calc_overview(), debug_menu::character_edit_menu(), check_needs_extremes(), talk_function::clear_mission(), game::critter_by_id(), iuse::crowbar(), mattack::dermatik(), monster::die(), npc::die(), avatar::do_read(), npc::execute_action(), dig_activity_actor::finish(), hacking_activity_actor::finish(), npc::finish_read(), player::fire_gun(), talk_function::follow(), item::get_remaining_chapters(), player::hardcoded_effects(), heal(), talk_function::hostile(), hurtall(), npc::is_ally(), item_location::impl::item_on_person::item_on_person(), talk_function::leave(), avatar::load(), game::load(), npc::load_npc_template(), item::mark_as_used_by_player(), item::mark_chapter_as_read(), iuse::marloss(), marloss_common(), iuse::marloss_gel(), iuse::marloss_seed(), mend(), iuse::mininuke(), mount_creature(), mutagen_common_checks(), mutate_towards(), npc::mutiny(), iuse::mycus(), iuse::note_bionics(), kill_tracker::notify(), talk_function::npc_die(), mattack::nurse_operate(), mission::on_creature_death(), perform_install(), perform_uninstall(), npc::randomize(), avatar::read(), npc::regen_ai_cache(), rem_addiction(), Creature::remove_effect(), game::reset_npc_dispositions(), map::rotate(), talk_effect_fun_t::set_add_mission(), vehicle_part::set_crew(), npc::set_fac(), npc::set_known_to_u(), npc::setpos(), game::start_game(), npc::start_read(), talk_function::start_training(), talk_function::stop_guard(), player::store(), survive_random_encounter(), npc::talk_to_u(), teleport::teleport(), test_crossing_threshold(), player::throw_item(), activity_handlers::train_finish(), npc::travel_overmap(), game::validate_npc_followers(), vomit(), and wake_up().
|
overridevirtual |
| tripoint_abs_omt Character::global_omt_location | ( | ) | const |
Returns the location of the player in global overmap terrain coordinates.
Definition at line 6336 of file character.cpp.
References global_square_location(), and ms_to_omt_copy().
Referenced by talk_function::abandon_camp(), computer_session::action_map_sewer(), computer_session::action_map_subway(), computer_session::action_maps(), activate_bionic(), activate_mutation(), apply_persistent_morale(), iuse::artifact(), talk_function::assign_camp(), talk_function::basecamp_mission(), burn_fuel(), talk_function::caravan_dist(), ui::omap::choose_point(), talk_function::companion_choose_return(), talk_function::companion_list(), talk_function::companion_mission(), npc::consume_food_from_camp(), mission_start::create_hidden_lab_console(), mission_start::create_ice_lab_console(), mission_start::create_lab_console(), game::disp_NPCs(), item::display_name(), ui::omap::display_visible_weather(), ui::omap::display_weather(), game::do_turn(), overmap_ui::draw_ascii(), draw_env_compact(), draw_loc_labels(), draw_location_classic(), game::draw_minimap(), draw_minimap(), basecamp::faction_display(), npc::faction_display(), talk_function::field_build_1(), talk_function::field_build_2(), talk_function::field_harvest(), mission_start::find_safety(), overmapbuffer::fix_npcs(), get_basecamp(), get_mission_om_origin(), overmapbuffer::get_npcs_near_omt(), overmapbuffer::get_npcs_near_player(), overmap_ui::get_overmap_path_to(), npc::go_to_omt_destination(), talk_function::goto_location(), npc::guard_current_pos(), talk_function::individual_mission(), mission_start::kill_horde_master(), game::list_missions(), spell_effect::map_area(), trapfunc::map_regen(), npc::move(), overmap_los(), passive_power_gen(), game::perhaps_add_random_npc(), mission_start::place_deposit_box(), mission_start::place_npc_software(), player::process_turn(), npc::reach_omt_destination(), talk_function::recover_camp(), teleporter_callback::refresh(), npc::regen_ai_cache(), render_wind(), game::reset_npc_dispositions(), reveal_destination(), mission_start::reveal_lab_train_depot(), mission_util::reveal_om_ter(), conditional_t< T >::set_at_om_location(), npc::set_companion_mission(), npc::set_omt_destination(), talk_function::start_camp(), game::start_game(), activity_handlers::travel_do_turn(), npc::travel_overmap(), activity_handlers::tree_communion_do_turn(), update_bodytemp(), game::update_overmap_seen(), reveal_map_actor::use(), game::vertical_notes(), iuse::weather_tool(), npc::within_boundaries_of_camp(), and game::zones_manager().
| tripoint Character::global_sm_location | ( | ) | const |
Returns the location of the player in global submap coordinates.
Definition at line 6331 of file character.cpp.
References global_square_location(), and ms_to_sm_copy().
Referenced by iuse::crowbar(), iuse::directional_antenna(), npc::faction_display(), hacking_activity_actor::finish(), overmapbuffer::get_npcs_near(), activity_handlers::lockpicking_finish(), mission_util::random_house_in_closest_city(), and memorial_logger::write().
|
virtual |
Global position, expressed in map square coordinate system (the most detailed coordinate system), used by the map.
Reimplemented in npc.
Definition at line 6326 of file character.cpp.
References get_map(), map::getabs(), and position.
Referenced by global_omt_location(), and global_sm_location().
| bool Character::handle_melee_wear | ( | item & | shield, |
| float | wear_multiplier = 1.0f |
||
| ) |
Calculates melee weapon wear-and-tear through use, returns true if item is destroyed.
Dexterity reduces chance of damaging your melee weapon Strength increases chance of damaging your melee weapon (NEGATIVE) Melee reduces chance of damaging your melee weaponDefinition at line 156 of file melee.cpp.
References _, Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), item::chip_resistance(), item::components, item::contents, dex_cur, g, get_skill_level(), item::gunmods(), item::has_flag(), item::inc_damage(), is_armed(), item::is_null(), itype_fur, itype_leather, itype_rag, m_bad, string_id< itype >::NULL_ID(), one_in(), pos(), visitable< Character >::remove_item(), skill_melee, item_contents::spill_contents(), str_cur, item::tname(), and wield().
Referenced by block_hit(), melee_special_effects(), player::reach_attack(), and smash().
| bool Character::has_active_bionic | ( | const bionic_id & | b | ) | const |
Returns true if the player has the entered bionic id and it is powered on.
Definition at line 1887 of file character.cpp.
References b, and my_bionics.
Referenced by absorb_hit(), activate_bionic(), active_light(), adjust_for_focus(), attack_cost(), player::basic_symbol_color(), burn_move_stamina(), character_martial_arts::can_arm_block(), can_feed_furnace_with(), can_feed_reactor_with(), character_martial_arts::can_leg_block(), player::can_sleep(), comestible_inventory_preset::comestible_inventory_preset(), crit_chance(), avatar::do_read(), do_skill_rust(), game::do_turn(), draw_bionics_titlebar(), draw_skills_tab(), iuse::ehandcuffs(), npc::finish_read(), get_env_resist(), get_hit_weapon(), ranged::gunmode_checks_weapon(), game::handle_action(), has_fire(), has_nv(), hearing_ability(), player::impact(), in_climate_control(), is_blind(), is_deaf(), is_immune_damage(), is_immune_field(), ma_requirements::is_valid_character(), game::item_action_menu(), trapfunc::ledge(), melee_attack(), melee_special_effects(), modify_morale(), game::monmove(), mut_cbm_encumb(), player::on_hit(), game::on_move_effects(), perform_technique(), character_martial_arts::pick_style(), trapfunc::pit(), trapfunc::pit_glass(), trapfunc::pit_spikes(), map::player_in_field(), player::process_items(), recalc_sight_limits(), npc::recharge_cbm(), game::remoteveh(), reset_stats(), mattack::riotbot(), roll_bash_damage(), roll_cut_damage(), roll_stab_damage(), run_cost(), player::search_surroundings(), sees_with_specials(), game::setremoteveh(), player::sleep_spot(), iuse::solarpack(), suffer_from_radiation(), player::throw_item(), throw_range(), player::try_to_sleep(), player::uncanny_dodge(), update_health(), update_needs(), update_stamina(), use_charges(), use_fire(), and npc::wants_to_recharge_cbm().
| bool Character::has_active_item | ( | const itype_id & | id | ) | const |
Whether the player carries an active item of the given item type.
Definition at line 2561 of file character.cpp.
References item::active, visitable< Character >::has_item_with(), and item::typeId().
Referenced by deactivate_bionic(), game::handle_action(), iuse::mp3(), game::remoteveh(), and game::setremoteveh().
| bool Character::has_active_mutation | ( | const trait_id & | b | ) | const |
Definition at line 367 of file mutation.cpp.
References b, and my_mutations.
Referenced by base_comfort_value(), player::basic_symbol_color(), can_drink_nectar(), drench(), avatar_action::eat_here(), fall_asleep(), get_working_arm_count(), game::handle_action(), player::hardcoded_effects(), is_hibernating(), avatar_action::move(), avatar_action::plthrow(), recalc_sight_limits(), roll_bash_damage(), roll_cut_damage(), sees(), sleep(), suffer_from_other_mutations(), player::try_to_sleep(), update_bodytemp(), and volume_capacity_reduced_by().
| bool Character::has_activity | ( | const activity_id & | type | ) | const |
Check if player currently has a given activity.
Definition at line 9222 of file character.cpp.
References activity, player_activity::id(), and type.
Referenced by calc_needs_rates(), can_use_floor_warmth(), cancel_activity(), inv_internal(), game::process_voluntary_act_interrupt(), mattack::pull_metal_weapon(), conditional_t< T >::set_has_activity(), and stop_hauling().
| bool Character::has_activity | ( | const std::vector< activity_id > & | types | ) | const |
Check if player currently has any of the given activities.
Definition at line 9227 of file character.cpp.
References activity, detail::find(), and player_activity::id().
| bool Character::has_addiction | ( | add_type | type | ) | const |
Returns true if the player has an addiction of the specified type.
Definition at line 1937 of file suffer.cpp.
References addictions, and type.
Referenced by player::sleep_spot().
| bool Character::has_alarm_clock | ( | ) | const |
Returns true if the player or their vehicle has an alarm clock.
Definition at line 835 of file character.cpp.
References bio_watch, get_map(), has_bionic(), has_item_with_flag(), pos(), map::veh_at(), and vehicle.
Referenced by player::hardcoded_effects(), sleep(), and wait().
| bool Character::has_any_bionic | ( | ) | const |
Returns true if the player has any bionic.
Definition at line 1897 of file character.cpp.
References get_bionics().
Referenced by mattack::nurse_operate().
|
virtual |
Reimplemented in npc.
Definition at line 3220 of file character.cpp.
References item::has_effect_when_carried(), item::has_effect_when_wielded(), visitable< Character >::has_item_with(), weapon, and worn.
Referenced by active_light(), player::basic_symbol_color(), deal_damage(), player::hardcoded_effects(), is_immune_damage(), is_invisible(), melee_attack(), recalc_sight_limits(), player::recalc_speed_bonus(), suffer_from_artifacts(), suffer_while_awake(), update_health(), game::walk_move(), and weight_capacity().
| bool Character::has_base_trait | ( | const trait_id & | b | ) | const |
Returns true if the player has the entered starting trait.
Definition at line 121 of file mutation.cpp.
Referenced by build_mut_dependency_map(), do_purify(), wish_mutate_callback::key(), mutate_towards(), old_mutate(), player::power_mutations_ui(), iuse::purify_iv(), iuse::purify_smart(), remove_mutation(), and debug_menu::wishmutate().
| bool Character::has_bionic | ( | const bionic_id & | b | ) | const |
Returns true if the player has the entered bionic id.
Definition at line 1877 of file character.cpp.
References b, and get_bionics().
Referenced by add_bionic(), iexamine::autodoc(), autodoc_internal(), bionics_install_failure(), talk_trial::calc_chance(), calc_needs_rates(), character_martial_arts::can_arm_block(), character_martial_arts::can_leg_block(), npc::can_read(), can_uninstall_bionic(), install_bionic_actor::can_use(), item::color_in_inventory(), consume_effects(), player::consume_med(), activity_handlers::cracking_do_turn(), deactivate_bionic(), draw_env_compact(), draw_speed_tab(), draw_time_classic(), player::eat(), iuse::einktabletpc(), iexamine::fireplace(), avatar::get_book_reader(), bionic_install_preset::get_denial(), bionic_install_surgeon_preset::get_denial(), get_temp(), player::get_weapon_dispersion(), player::hardcoded_effects(), has_alarm_clock(), has_enough_anesth(), has_fire(), has_watch(), is_immune_effect(), player::load(), game::on_move_effects(), activity_handlers::operation_do_turn(), overmap_sight_range(), iexamine::pay_gas(), sounds::process_sound_markers(), read_speed(), recalc_sight_limits(), player::recalc_speed_bonus(), iuse::robotcontrol(), roll_cut_damage(), roll_stab_damage(), run_cost(), iexamine::safe(), conditional_t< T >::set_has_bionics(), sight_impaired(), suffer_from_asthma(), suffer_from_bad_bionics(), suffer_from_radiation(), suffer_from_sunburn(), suffer_while_underwater(), try_start_hacking(), update_bodytemp(), consume_drug_iuse::use(), game::use_computer(), use_fire(), volume_capacity_reduced_by(), avatar::wake_up(), game::walk_move(), and will_eat().
| bool Character::has_charges | ( | const itype_id & | it, |
| int | quantity, | ||
| const std::function< bool(const item &)> & | filter = return_true<item> |
||
| ) | const |
Definition at line 9598 of file character.cpp.
References visitable< Character >::charges_of(), debugmsg, flag_BIONIC_ARMOR_INTERFACE, units::from_kilojoule(), get_power_level(), has_fire(), has_power(), is_mounted(), itype_apparatus, itype_bio_armor, itype_fire, itype_UPS, MF_RIDEABLE_MECH, mounted_creature, and my_bionics.
Referenced by iexamine::arcfurnace_empty(), iuse::cable_attach(), can_eat(), iexamine::can_fertilize(), player::can_reload(), cauterize_actor::can_use(), craft_command::check_item_components_missing(), craft_command::check_tool_components_missing(), consume_charges(), player::consume_med(), consume_remote_fuel(), player::craft_consume_tools(), iuse::ecig(), activity_handlers::fertilize_plot_do_turn(), find_remote_fuel(), crafting::find_tool_component(), iuse::firecracker_pack(), player::gunmod_add(), ranged::gunmode_checks_weapon(), has_enough_charges(), has_fire(), npc::heal_self(), iexamine::kiln_empty(), npc::move(), iexamine::pay_gas(), avatar_action::reload(), talk_effect_fun_t::set_consume_item(), conditional_t< T >::set_has_items(), talk_effect_fun_t::set_u_sell_item(), smoker_activate(), iuse::smoking(), suffer_from_asthma(), try_consume(), try_start_hacking(), consume_drug_iuse::use(), use_charges_if_avail(), and use_fire().
| bool Character::has_child_flag | ( | const trait_id & | flag | ) | const |
Returns true if the player has the entered mutation child flag.
Definition at line 1485 of file mutation.cpp.
References has_child_flag(), has_trait(), and mutation_branch::replacements.
Referenced by has_child_flag(), mutate_towards(), mutation_ok(), and remove_child_flag().
| bool Character::has_destination | ( | ) | const |
Definition at line 10489 of file character.cpp.
References auto_move_route.
Referenced by cancel_auto_move(), debug_menu::character_edit_menu(), defer_move(), npc::do_player_activity(), game::do_turn(), get_next_auto_move_direction(), game::handle_action(), has_distant_destination(), npc::on_load(), and game::process_voluntary_act_interrupt().
| bool Character::has_destination_activity | ( | ) | const |
Definition at line 10494 of file character.cpp.
References destination_point, get_destination_activity(), get_map(), map::getlocal(), player_activity::is_null(), and position.
Referenced by game::handle_action(), npc::move(), npc::move_to(), and start_destination_activity().
| bool Character::has_distant_destination | ( | ) | const |
Definition at line 10478 of file character.cpp.
References ACT_TRAVELLING, get_destination_activity(), has_destination(), player_activity::id(), player_activity::is_null(), and omt_path.
Referenced by game::cancel_activity_or_ignore_query(), game::cancel_activity_query(), and game::do_turn().
Has enough anesthetic for surgery.
Definition at line 1823 of file bionics.cpp.
References bio_painkiller, itype::bionic, requirement_data::can_make_with_inventory(), crafting_inventory(), debugmsg, itype::get_id(), has_bionic(), has_trait(), is_crafting_component(), trait_DEBUG_BIONICS, and trait_NOPAIN.
Referenced by bionic_install_preset::get_denial(), and bionic_uninstall_preset::get_denial().
| bool Character::has_enough_charges | ( | const item & | it, |
| bool | show_msg | ||
| ) | const |
Has the item enough charges to invoke its use function? Also checks if UPS from this player is used instead of item charges.
Definition at line 7461 of file character.cpp.
References Creature::add_msg_if_player(), item::ammo_remaining(), item::ammo_required(), item::ammo_sufficient(), Creature::as_player(), flag_USE_UPS(), has_charges(), item::has_flag(), item::is_power_armor(), item::is_tool(), itype_bio_armor, itype_UPS, m_info, item::tname(), and vgettext().
Referenced by activatable_inventory_preset::get_denial(), invoke_item(), iuse::jackhammer(), and iuse::note_bionics().
| bool Character::has_fire | ( | int | quantity | ) | const |
Definition at line 9745 of file character.cpp.
References all_items_with_flag(), bio_laser, bio_lighter, bio_tools, firestarter_actor::can_use(), debugmsg, use_function::get_actor_ptr(), get_map(), get_power_level(), has_active_bionic(), has_bionic(), has_charges(), has_item_with_flag(), Creature::is_npc(), pos(), and tripoint_zero.
Referenced by has_charges(), and symbol_color().
|
overridevirtual |
Returns true if the player has a grab breaking technique available.
Implements Creature.
Definition at line 1209 of file martialarts.cpp.
References martial_arts_data.
Referenced by player::can_grab_break(), deal_damage(), and mattack::grab().
| bool Character::has_item_with_flag | ( | const std::string & | flag, |
| bool | need_charges = false |
||
| ) | const |
Definition at line 9581 of file character.cpp.
References item::has_flag(), visitable< Character >::has_item_with(), and item::is_tool().
Referenced by draw_env_compact(), draw_time_classic(), npc::faction_display(), get_temp(), has_alarm_clock(), has_fire(), has_watch(), loot(), overmap_sight_range(), npc::reach_omt_destination(), and use_fire().
| bool Character::has_mabuff | ( | const mabuff_id & | buff_id | ) | const |
Returns true if the player has any martial arts buffs attached.
Definition at line 1202 of file martialarts.cpp.
References b, Creature::effects, id, and search_ma_buff_effect().
Referenced by ma_requirements::is_valid_character().
| bool Character::has_max_power | ( | ) | const |
Definition at line 2014 of file character.cpp.
References max_power_level.
Referenced by bionics_install_failure(), power_stat(), conditional_t< T >::set_has_bionics(), and suffer_from_bad_bionics().
| bool Character::has_morale | ( | const morale_type & | type | ) | const |
Definition at line 9102 of file character.cpp.
Referenced by player::fire_gun(), suffer_from_other_mutations(), and iuse::towel_common().
| bool Character::has_morale_to_craft | ( | ) | const |
Definition at line 335 of file crafting.cpp.
References get_morale_level().
Referenced by game::butcher(), veh_interact::cant_do(), and iuse::multicooker().
| bool Character::has_morale_to_read | ( | ) | const |
Definition at line 9122 of file character.cpp.
References get_morale_level().
Referenced by avatar::get_book_reader().
| bool Character::has_nv | ( | ) |
Returns true if the player has some form of night vision.
Definition at line 3629 of file character.cpp.
References bio_night_vision, flag_EFFECT_NIGHT_VISION(), flag_GNV_EFFECT(), has_active_bionic(), Creature::has_effect_with_flag(), nv_cached, and worn_with_flag().
Referenced by recalc_sight_limits().
| bool Character::has_opposite_trait | ( | const trait_id & | flag | ) | const |
Returns true if character has a trait which cancels the entered trait.
Definition at line 9911 of file character.cpp.
References mutation_branch::cancels, has_trait(), and my_mutations.
Referenced by known_magic::can_learn_spell(), and newcharacter::has_conflicting_trait().
| bool Character::has_power | ( | ) | const |
Definition at line 2009 of file character.cpp.
References power_level.
Referenced by player::can_sleep(), has_charges(), player::try_to_sleep(), iuse_transform::use(), set_transform_iuse::use(), and use_charges().
| bool Character::has_stashed_activity | ( | ) | const |
Definition at line 984 of file character.cpp.
References stashed_outbounds_activity.
Referenced by npc::move().
|
overridevirtual |
Returns true if the player has the entered trait.
Reimplemented from Creature.
Definition at line 103 of file mutation.cpp.
References b, enchantment_cache, and my_mutations.
Referenced by absorb_hit(), activate_mutation(), add_addiction(), add_bionic(), player::add_pain_msg(), newcharacter::add_traits(), addict_effect(), adjust_for_focus(), alcohol(), allergy_type(), iuse::anticonvulsant(), iuse::antiparasitic(), apply_damage(), apply_persistent_morale(), monster::attitude(), iexamine::autodoc(), autodoc_internal(), iexamine::bars(), base_comfort_value(), player::basic_symbol_color(), bionics_pl_skill(), iuse::blech(), iuse::blood_draw(), bloodType(), activity_handlers::build_do_turn(), burn_move_stamina(), calc_all_parts_hp(), talk_trial::calc_chance(), player::calc_focus_equilibrium(), calc_needs_rates(), player::can_continue_craft(), can_eat(), can_install_bionics(), spell::can_learn(), player::can_lift(), can_pick_weight(), npc::can_read(), cauterize_actor::can_use(), install_bionic_actor::can_use(), can_wear(), veh_interact::cant_do(), cauterize_actor::cauterize_effect(), iexamine::chainfence(), check_needs_extremes(), game::check_safe_mode_allowed(), game::cleanup_at_end(), item::color_in_inventory(), talk_function::commune_farmfield(), talk_function::companion_mission(), veh_interact::complete_vehicle(), construction_color(), consume_effects(), player::consume_item(), player::consume_items(), player::consume_tools(), iuse::contacts(), game::control_vehicle(), player::craft_consume_tools(), crafting_inventory(), player::crafting_success_roll(), avatar::create(), craft_command::create_in_progress_craft(), iuse::datura(), deal_damage(), debug_vision(), mattack::dermatik(), trap::detect_trap(), monster::die(), character_display::disp_info(), avatar::disp_morale(), do_purify(), game::do_turn(), construct::done_vehicle(), overmap_ui::draw_ascii(), draw_limb_health(), overmap_ui::draw_om_sidebar(), draw_speed_tab(), drench(), player::eat(), eff_fun_spores(), iuse::einktabletpc(), game::extended_description(), player::fall_damage_mod(), talk_function::field_harvest(), game::find_or_make_stairs(), character_funcs::fine_detail_vision_mod(), npc::finish_read(), player::fire_gun(), floor_warmth(), iexamine::flower_dahlia(), talk_function::forage_return(), npc::form_opinion(), fun_for(), fungal_effects::fungalize(), character_funcs::get_book_fun_for(), avatar::get_book_reader(), get_dodge(), get_env_resist(), get_face_type(), get_hunger_description(), get_miss_reason(), npc::get_monster_faction(), overmap_ui::get_overmap_neighbors(), get_pain_description(), character_effects::get_pain_penalty(), get_shout_volume(), player::gunmod_add(), player::gunmod_installation_odds(), game::handle_action(), player::hardcoded_effects(), hardcoded_mutation_attack(), iexamine::harvest_plant(), has_child_flag(), has_enough_anesth(), newcharacter::has_higher_trait(), newcharacter::has_lower_trait(), has_opposite_trait(), newcharacter::has_same_type_trait(), hearing_ability(), hit_roll(), hurtall(), player::immune_to(), in_climate_control(), install_bionics(), introduce_into_anesthesia(), irradiate(), is_deaf(), character_funcs::is_fun_to_read(), is_immune_damage(), is_immune_effect(), is_immune_field(), is_invisible(), wish_mutate_callback::key(), game::knockback(), talk_function::labor_return(), known_magic::learn_spell(), trapfunc::ledge(), iexamine::ledge(), player::load(), marloss_common(), marloss_prevented(), iuse::meditate(), melee_attack(), mend(), player::mend_item(), iuse::meth(), player::mod_pain(), modify_morale(), modify_stimulation(), game::mon_info_update(), avatar_action::move(), iuse::multicooker(), mutate(), mutate_category(), mutate_towards(), mutation_chances(), mutation_ok(), iuse::mycus(), old_mutate(), player::on_hit(), on_hurt(), npc::on_load(), iexamine::pay_gas(), perform_install(), pick_part_to_heal(), activity_handlers::pickaxe_finish(), trapfunc::pit(), trapfunc::pit_glass(), trapfunc::pit_spikes(), game::place_player(), iuse::plantblech(), player_can_build(), player_can_see_to_build(), map::player_in_field(), iuse::poison(), iuse::portable_game(), player::practice(), print_health(), game::print_terrain_info(), player::process_effects_internal(), item::process_litcig(), player::process_one_effect(), sounds::process_sound_markers(), player::process_turn(), iuse::purify_iv(), iuse::purify_smart(), avatar::randomize(), npc::randomize(), react_to_felt_pain(), avatar::read(), recalc_sight_limits(), player::recalc_speed_bonus(), wish_mutate_callback::refresh(), remove_child_flag(), remove_mutation(), player::reset_stats(), firestarter_actor::resolve_firestarter_use(), iuse::robotcontrol(), talk_trial::roll(), roll_bash_damage(), rooted(), rooted_message(), iexamine::rubble(), run_cost(), npc::say(), talk_function::scavenging_patrol_return(), sees_with_specials(), player::select_item_component(), conditional_t< T >::set_has_any_trait(), conditional_t< T >::set_has_trait(), set_traits(), shout(), iexamine::shrub_marloss(), sight_impaired(), iexamine::sign(), trapfunc::sinkhole(), player::sleep_spot(), game::slip_down(), avatar::steal(), stumble(), suffer(), suffer_from_addictions(), suffer_from_chemimbalance(), suffer_from_other_mutations(), suffer_from_radiation(), suffer_from_sunburn(), suffer_in_sunlight(), suffer_while_awake(), suffer_while_underwater(), swim_speed(), npc::talk_to_u(), test_crossing_threshold(), npc::time_to_read(), avatar::time_to_read(), player::toolmod_add(), iexamine::trap(), activity_handlers::tree_communion_do_turn(), iexamine::tree_marloss(), try_reject_mutagen(), try_start_hacking(), player::try_to_sleep(), uninstall_bionic(), update_body(), player::update_body_wetness(), update_bodytemp(), update_needs(), game::update_stair_monsters(), update_stomach(), consume_drug_iuse::use(), cauterize_actor::use(), enzlave_actor::use(), mutagen_actor::use(), mutagen_iv_actor::use(), game::use_computer(), game::vertical_move(), iuse::vibe(), volume_capacity_reduced_by(), player::vomit_mod(), game::walk_move(), iuse::weed_cake(), weed_msg(), weight_capacity(), weather_effect::wet_player(), will_eat(), and debug_menu::wishmutate().
| bool Character::has_trait_flag | ( | const std::string & | b | ) | const |
Returns true if player has a trait with a flag.
Definition at line 108 of file mutation.cpp.
References b, mutation_branch::flags, and get_mutations().
Referenced by consider_butchery(), do_skill_rust(), mod_rad(), mod_thirst(), player::practice(), conditional_t< T >::set_has_trait_flag(), spell::spell_fail(), enzlave_actor::use(), and will_eat().
| bool Character::has_two_arms | ( | ) | const |
Returns true if the player has two functioning arms.
Returns true if the character has two functioning arms.
Definition at line 1280 of file character.cpp.
References get_working_arm_count().
Referenced by can_wear(), player::can_wield(), ranged::gunmode_checks_common(), hardcoded_mutation_attack(), map::player_in_field(), and mattack::riotbot().
| bool Character::has_watch | ( | ) | const |
Returns true if the player or their vehicle has a watch.
Definition at line 844 of file character.cpp.
References bio_watch, get_map(), has_bionic(), has_item_with_flag(), pos(), map::veh_at(), and vehicle.
Referenced by draw_loc_labels(), draw_time(), draw_time_classic(), game::list_missions(), and wait().
|
overridevirtual |
Implements Creature.
Definition at line 10348 of file character.cpp.
References unarmed_attack().
Referenced by perform_technique(), and pick_technique().
| int Character::head_cloth_encumbrance | ( | ) | const |
Returns the total encumbrance of all SKINTIGHT and HELMET_COMPAT items coveringi the head.
Definition at line 8910 of file character.cpp.
References bp_head, flag_HELMET_COMPAT(), flag_SEMITANGIBLE(), flag_SKINTIGHT(), item::get_encumber(), item::has_flag(), cata::hash64_detail::ret, and worn.
Referenced by can_wear().
| void Character::heal | ( | const bodypart_id & | healed, |
| int | dam | ||
| ) |
Heals a body_part for dam.
Definition at line 8640 of file character.cpp.
References character_heals_damage, g, Creature::get_part_hp_cur(), Creature::get_part_hp_max(), getID(), is_limb_broken(), and Creature::mod_part_hp_cur().
Referenced by enforce_minimum_healing(), heal_actor::finish_using(), give_aid_to(), healall(), process_bionic(), regen(), and suffer_water_damage().
| void Character::healall | ( | int | dam | ) |
Heals all body parts for dam.
Definition at line 8649 of file character.cpp.
References Creature::get_all_body_parts(), heal(), and Creature::mod_part_healed_total().
Referenced by iuse::artifact(), consume_effects(), player::hardcoded_effects(), spell::heal(), iuse::jet_injector(), melee_attack(), iuse::mycus(), regen(), and suffer_from_radiation().
| void Character::healed_bp | ( | int | bp, |
| int | amount | ||
| ) |
| float Character::healing_rate | ( | float | at_rest_quality | ) | const |
Average hit points healed per turn.
Definition at line 6764 of file character.cpp.
References add_msg(), get_healthy(), Creature::is_npc(), m_debug, mutation_value(), and name.
Referenced by regen().
| float Character::healing_rate_medicine | ( | float | at_rest_quality, |
| const bodypart_id & | bp | ||
| ) | const |
Average hit points healed per turn from healing effects.
Definition at line 6806 of file character.cpp.
References effect_bandaged, effect_disinfected, effect::get_amount(), Creature::get_effect(), get_healthy(), effect::is_null(), and mutation_value().
Referenced by regen().
| float Character::hearing_ability | ( | ) | const |
Definition at line 10273 of file character.cpp.
References bio_earplugs, bio_ears, effect_deaf, effect_earphones, Creature::get_effect_dur(), has_active_bionic(), Creature::has_effect(), has_trait(), mutation_value(), rng(), and trait_PER_SLIME.
Referenced by can_hear(), and sounds::process_sound_markers().
| void Character::heat_emission | ( | int | b, |
| int | fuel_energy | ||
| ) |
Handle heat from exothermic power generation.
Definition at line 1453 of file bionics.cpp.
References Creature::add_effect(), b, effect_heating_bionic, map::emit_field(), bionic_data::exothermic_power_gen, bionic_data::fuel_efficiency, get_map(), bionic::info(), string_id< T >::is_valid(), bionic_data::occupied_bodyparts, pos(), and to_string().
Referenced by burn_fuel(), and passive_power_gen().
| int Character::height | ( | ) | const |
Definition at line 6945 of file character.cpp.
References abort, debugmsg, get_size(), init_height, MS_HUGE, MS_LARGE, MS_MEDIUM, MS_SMALL, and MS_TINY.
Referenced by bodyweight(), height_string(), and set_base_height().
| std::string Character::height_string | ( | ) | const |
Definition at line 6930 of file character.cpp.
References _, height(), and string_format().
Referenced by draw_stats_info(), and draw_stats_tab().
|
overridevirtual |
Returns the player's basic hit roll that is compared to the target's dodge roll.
Implements Creature.
Definition at line 297 of file melee.cpp.
References bp_torso, effect_bouldering, effect_contacts, encumb(), get_melee_hit_base(), Creature::has_effect(), has_trait(), melee::melee_hit_range(), trait_HYPEROPIC, and worn_with_flag().
Referenced by player::disarm(), melee_attack(), perform_special_attacks(), and scored_crit().
| int Character::hitall | ( | int | dam, |
| int | vary, | ||
| Creature * | source | ||
| ) |
Harms all body parts for dam, with armor reduction.
If vary > 0 damage to parts are random within vary % (1-100)
Definition at line 8675 of file character.cpp.
References convert_bp(), deal_damage(), hp_to_bp(), string_id< T >::id(), num_hp_parts, damage_instance::physical(), rng(), and dealt_damage_instance::total_damage().
Referenced by game::forced_door_closing(), and vehicle::part_collision().
Converts an hp_part to a body_part.
Definition at line 6589 of file character.cpp.
References bp_arm_l, bp_arm_r, bp_head, bp_leg_l, bp_leg_r, bp_torso, hp_arm_l, hp_arm_r, hp_head, hp_leg_l, hp_leg_r, hp_torso, and num_bp.
Referenced by iexamine::autodoc(), cauterize_actor::cauterize_effect(), draw_limb_health(), heal_actor::finish_using(), hitall(), player::impact(), pick_part_to_heal(), map::player_in_field(), regen(), heal_actor::use_healing_item(), and npc::wear_if_wanted().
| void Character::hurtall | ( | int | dam, |
| Creature * | source, | ||
| bool | disturb = true |
||
| ) |
Hurts all body parts for dam, no armor reduction.
Definition at line 8657 of file character.cpp.
References character_takes_damage, g, Creature::get_all_body_parts(), Creature::get_part_hp_cur(), getID(), has_trait(), Creature::is_dead_state(), Creature::mod_pain(), Creature::mod_part_hp_cur(), on_hurt(), and trait_DEBUG_NODMG.
Referenced by trapfunc::drain(), player::hardcoded_effects(), marloss_common(), trapfunc::pit(), map::player_in_field(), game::process_artifact(), regen(), map::shake_vehicle(), suffer_from_bad_bionics(), suffer_from_radiation(), trapfunc::tripwire(), and try_reject_mutagen().
Definition at line 2321 of file character.cpp.
References inventory::add_item(), allocated_invlets(), inventory::assigned_invlet, cached_info, inv, item::invlet, item::is_ammo(), item::is_armor(), item::is_book(), item::is_food(), item::is_food_container(), item::is_gun(), item::is_melee(), item::is_tool(), last_item, item::on_pickup(), item::typeId(), and inventory::unsort().
Referenced by player::add_or_drop_with_msg(), iuse::adrenaline_injector(), iuse::arrow_flammable(), debug_menu::debug(), fetch_activity(), give_item_to(), handle_harvest(), i_add_or_drop(), mount_creature(), npc::mug_player(), iuse::multicooker(), item_location::impl::item_on_map::obtain(), item_location::impl::item_on_person::obtain(), item_location::impl::item_on_vehicle::obtain(), item_location::impl::item_in_container::obtain(), pick_one_up(), npc::pick_up_item(), iuse::purify_smart(), iuse::radiocar(), item::reload(), monexamine::remove_leash(), mattack::riotbot(), talk_effect_fun_t::set_bulk_trade_accept(), set_item_inventory(), talk_effect_fun_t::set_u_buy_item(), talk_effect_fun_t::set_u_sell_item(), gun_actor::shoot(), avatar::steal(), npc::stow_item(), npc_trading::transfer_items(), ammobelt_actor::use(), iuse::vaccine(), and avatar_action::wield().
| bool Character::i_add_or_drop | ( | item & | it, |
| int | qty = 1 |
||
| ) |
Sets invlet and adds to inventory if possible, drops otherwise, returns true if either succeeded.
An optional qty can be provided (and will perform better than separate calls).
Definition at line 2459 of file character.cpp.
References om_direction::add(), map::add_item_or_charges(), inventory::assign_empty_invlet(), can_pick_volume(), can_pick_weight(), drop(), get_map(), i_add(), inv, item::is_gun(), item::is_irremovable(), item::is_null(), LIQUID, item::made_of(), and pos().
Referenced by activate_mutation(), salvage_actor::cut_up(), drop_or_handle(), heal_actor::finish_using(), player::gunmod_remove(), item_contents::handle_liquid_or_spill(), iexamine::pedestal_wyrm(), item::reload(), remove_radio_mod(), player::unload(), consume_drug_iuse::use(), bandolier_actor::use(), iexamine::vending(), and debug_menu::wishitem().
| int Character::i_add_to_container | ( | const item & | it, |
| bool | unloading | ||
| ) |
Try to find a container/s on character containing ammo of type it.typeId() and add charges until the container is full.
| unloading | Do not try to add to a container when the item was intentionally unloaded. |
Definition at line 2285 of file character.cpp.
References add_msg(), item::charges, item::contents, item_contents::front(), item::is_ammo(), item::is_ammo_container(), NEXT, pgettext(), item::tname(), item::typeId(), and visitable< Character >::visit_items().
Referenced by player::add_or_drop_with_msg(), and pick_one_up().
| item & Character::i_at | ( | int | position | ) |
Definition at line 2402 of file character.cpp.
References i_at(), and position.
Referenced by npc::activate_item(), npc::consume_cbm_items(), npc::consume_food(), activity_handlers::fill_liquid_do_turn(), i_at(), activity_handlers::longsalvage_finish(), player_activity::migrate_item_position(), item_location::impl::item_on_person::obtain(), iexamine::pay_gas(), player::reduce_charges(), activity_handlers::repair_item_finish(), player::takeoff(), player::use(), and player::wear().
| const item & Character::i_at | ( | int | position | ) | const |
Definition at line 2385 of file character.cpp.
References inventory::find_item(), inv, position, weapon, worn, and worn_position_to_index().
Remove a specific item from player possession.
The item is compared by pointer. Contents of the item are removed as well.
| it | A pointer to the item to be removed. The item must exists in the players possession (one can use has_item to check for this). |
Definition at line 2442 of file character.cpp.
References debugmsg, visitable< Character >::remove_items_with(), and item::tname().
| item Character::i_rem | ( | int | pos | ) |
Remove a specific item from player possession.
The item is compared by pointer. Contents of the item are removed as well.
| pos | The item position of the item to be removed. The item must exists, use has_item to check this. |
Definition at line 2424 of file character.cpp.
References inv, item::on_takeoff(), pos(), inventory::remove_item(), weapon, worn, and worn_position_to_index().
Referenced by monexamine::add_leash(), apply_damage(), mattack::bio_op_disarm(), iuse::blood_draw(), player::consume(), consume_charges(), player::disarm(), drop_invalid_inventory(), npc::drop_items(), iuse::fish_trap(), activity_handlers::gunmod_add_finish(), ranged::handle_gun_damage(), i_rem_keep_contents(), invoke_item(), activity_handlers::lockpicking_finish(), iuse::lumber(), npc::mug_player(), npc_throw(), pickup::obtain_and_tokenize_items(), iuse::radiocar(), player::reduce_charges(), avatar::steal(), player::store(), tidy_activity(), unpack_actor::use(), and avatar::wield().
| void Character::i_rem_keep_contents | ( | int | idx | ) |
Definition at line 2454 of file character.cpp.
References i_rem(), pos(), and item::spill_contents().
Referenced by damage_item(), and sew_advanced_actor::use().
| bool Character::in_climate_control | ( | ) |
Returns true if the player is in a climate controlled area or armor.
Definition at line 3828 of file character.cpp.
References bio_climate, flag_CLIMATE_CONTROL, flag_FUNGUS(), get_map(), has_active_bionic(), map::has_flag_ter_or_furn(), has_trait(), in_sleep_state(), last_climate_control_ret, next_climate_control_check, pos(), string_id< T >::str(), trait_M_SKIN3, calendar::turn, map::veh_at(), and worn.
Referenced by update_bodytemp().
|
overridevirtual |
Reimplemented from Creature.
Definition at line 9320 of file character.cpp.
References ACT_TRY_SLEEP, activity, player_activity::id(), and Creature::in_sleep_state().
Referenced by npc::address_needs(), npc::address_player(), block_hit(), can_use_floor_warmth(), check_needs_extremes(), npc::complain_about(), npc::execute_action(), npc::faction_display(), player::get_crafting_helpers(), get_dodge(), player::hardcoded_effects(), in_climate_control(), is_deaf(), npc::move_to(), game::npc_menu(), player::practice(), player::process_one_effect(), sounds::process_sound_markers(), player::process_turn(), recalc_sight_limits(), suffer(), suffer_from_asthma(), suffer_from_bad_bionics(), suffer_from_other_mutations(), suffer_from_radiation(), suffer_from_stimulants(), symbol_color(), and update_bodytemp().
|
overridevirtual |
| void Character::initialize_stomach_contents | ( | ) |
Definition at line 195 of file stomach.cpp.
References stomach.
| bool Character::install_bionics | ( | const itype & | type, |
| player & | installer, | ||
| bool | autodoc = false, |
||
| int | skill_level = -1 |
||
| ) |
Initialize all the values needed to start the operation player_activity.
Definition at line 2242 of file bionics.cpp.
References ACT_OPERATION, activity, Creature::add_effect(), assign_activity(), iexamine::autodoc(), bionic_manip_cos(), bionics_adjusted_skill(), bionics_pl_skill(), bionic_data::canceled_mutations, bionic_data::capacity, debugmsg, disp_name(), effect_under_op, has_trait(), bionic_data::occupied_bodyparts, perform_install(), player::practice(), rng(), skill_computer, skill_electronics, skill_firstaid, skill_mechanics, string_id< T >::str(), player_activity::str_values, behavior::success, units::to_joule(), trait_DEBUG_BIONICS, trait_PROF_AUTODOC, trait_PROF_MED, type, bionic_data::upgraded_bionic, and player_activity::values.
Referenced by iexamine::autodoc(), and install_bionic_actor::use().
| void Character::introduce_into_anesthesia | ( | const time_duration & | duration, |
| player & | installer, | ||
| bool | needs_anesthesia | ||
| ) |
Handles process of introducing patient into anesthesia during Autodoc operations.
Requires anesthesia kits or NOPAIN mutation
Definition at line 2833 of file bionics.cpp.
References _, Creature::add_effect(), Creature::add_msg_if_player(), player::add_msg_if_player(), Creature::add_msg_player_or_npc(), player::add_msg_player_or_npc(), effect_narcosis, fall_asleep(), Creature::get_effect_dur(), Creature::has_effect(), has_trait(), m_info, m_mixed, trait_CENOBITE, trait_DEBUG_BIONICS, trait_MASOCHIST, trait_MASOCHIST_MED, and trait_THRESH_MEDICAL.
Referenced by iexamine::autodoc().
| std::vector< item * > Character::inv_dump | ( | ) |
Definition at line 8959 of file character.cpp.
References can_unwield(), inventory::dump(), inv, is_armed(), cata::hash64_detail::ret, behavior::success, weapon, and worn.
Referenced by npc::apply_ownership_to_inv(), are_requirements_nearby(), npc::die(), generic_multi_activity_locations(), irradiate(), game::load(), item_action_generator::map_actions_to_items(), place_corpse(), conditional_t< T >::set_has_stolen_item(), sleep(), game::start_game(), and tidy_activity().
| void Character::invalidate_crafting_inventory | ( | ) |
Definition at line 595 of file crafting.cpp.
References calendar::before_time_starts, cached_position, cached_time, and tripoint_min.
Referenced by activate_bionic(), iexamine::autodoc(), can_do_activity_there(), veh_interact::complete_vehicle(), iexamine::cvdmachine(), deactivate_bionic(), wash_activity_actor::finish(), activity_handlers::mend_item_finish(), mill_load_food(), iexamine::nanofab(), veh_utils::repair_part(), smoker_load_food(), avatar_action::use_item(), and debug_menu::wishitem().
| item * Character::invlet_to_item | ( | int | invlet | ) |
Return the item pointer of the item with given invlet, return nullptr if the player does not have such an item with that invlet.
Don't use this on npcs. Only use the invlet in the user interface, otherwise always use the item position.
Definition at line 2361 of file character.cpp.
References item::invlet, SKIP, and visitable< Character >::visit_items().
Referenced by pick_one_up(), player::reassign_item(), inventory::restack(), player::sort_armor(), and game_menus::inv::swap_letters().
|
virtual |
As above two, but with position equal to current position.
Reimplemented in avatar, npc, avatar, and npc.
Definition at line 7322 of file character.cpp.
References invoke_item(), and pos().
|
virtual |
Reimplemented in avatar, npc, avatar, and npc.
Definition at line 7332 of file character.cpp.
References invoke_item(), and pos().
|
virtual |
As above, but with a pre-selected method.
Debugmsg if this item doesn't have this method.
Reimplemented in avatar, npc, and avatar.
Definition at line 7337 of file character.cpp.
References Creature::as_player(), consume_charges(), debugmsg, item::get_contained(), item::get_usable_item(), has_enough_charges(), i_rem(), itype::invoke(), item::is_bionic(), item::is_deployable(), item::is_medication(), item::is_tool(), item::tname(), and item::type.
Asks how to use the item (if it has more than one use_method) and uses it.
Returns true if it destroys the item. Consumes charges from the item. Multi-use items are ONLY supported when all use_methods are iuse_actor!
Reimplemented in avatar, npc, avatar, and npc.
Definition at line 7327 of file character.cpp.
Referenced by activate_bionic(), activate_mutation(), invoke_item(), avatar::invoke_item(), npc::invoke_item(), player::use(), and iexamine::use_furn_fake_item().
| bool Character::irradiate | ( | float | rads, |
| bool | bypass = false |
||
| ) |
Handles mitigation and application of radiation.
Definition at line 1531 of file suffer.cpp.
References _, Creature::add_msg_if_player(), effect_iodine, Creature::has_effect(), visitable< T >::has_item(), has_trait(), inv, inv_dump(), is_rad_immune(), is_wearing_power_armor(), itype_rad_badge, m_warning, mod_rad(), rad_badge_color(), rng(), roll_remainder(), trait_RADIOACTIVE1, trait_RADIOACTIVE2, trait_RADIOACTIVE3, and worn_with_flag().
Referenced by trapfunc::glow(), modify_radiation(), map::player_in_field(), game::process_artifact(), mattack::science(), and suffer_from_radiation().
| bool Character::is_armed | ( | ) | const |
Returns true if the character is wielding something.
Note: this item may not actually be used to attack.
Definition at line 145 of file melee.cpp.
References item::is_null(), and weapon.
Referenced by mattack::bio_op_disarm(), mattack::bio_op_random_biojutsu(), mattack::bio_op_takedown(), player::can_wield(), cast_spell(), npc::check_or_use_weapon_cbm(), pickup::cost_to_move_item(), avatar::create(), player::disarm(), draw_weapon_classic(), draw_weapon_classic_alt(), fire(), npc::form_opinion(), player::get_artifact_items(), pickup_inventory_preset::get_denial(), get_overlay_ids(), mattack::grab(), game::handle_action(), handle_melee_wear(), handle_problematic_pickup(), inv_dump(), ma_requirements::is_valid_character(), character_martial_arts::martialart_use_message(), melee_special_effects(), avatar_action::mend(), npc::move_to(), npc::mug_player(), game::npc_menu(), item_location::impl::item_on_person::obtain_cost(), player::on_dodge(), parse_tags(), perform_technique(), avatar_action::plthrow(), npc::print_info(), mattack::riotbot(), examine_item_menu::run(), character_martial_arts::selected_style_name(), short_description_parts(), smash(), start_hauling(), avatar::steal(), player::weapname(), npc::wield(), avatar_action::wield(), and player::wield_contents().
| bool Character::is_auto_moving | ( | ) | const |
Definition at line 10484 of file character.cpp.
References destination_point.
Referenced by game::handle_action(), and avatar_action::move().
| bool Character::is_blind | ( | ) | const |
Returns true if the player isn't able to see.
Definition at line 6342 of file character.cpp.
References bio_blindfold, effect_blind, flag_BLIND(), has_active_bionic(), Creature::has_effect(), and worn_with_flag().
Referenced by iuse::camera(), game::find_nearby_items(), character_funcs::fine_detail_vision_mod(), game::get_dangerous_tile(), player::hardcoded_effects(), item_save_monsters(), iuse::mop(), avatar_action::move(), game::place_player(), recalc_sight_limits(), show_photo_selection(), and game::use_computer().
| bool Character::is_category_allowed | ( | const std::string & | category | ) | const |
| bool Character::is_category_allowed | ( | const std::vector< std::string > & | category | ) | const |
Returns true if this category of mutation is allowed.
Definition at line 373 of file mutation.cpp.
References get_mutations().
Referenced by mutation_ok(), and old_mutate().
| bool Character::is_deaf | ( | ) | const |
Definition at line 4486 of file character.cpp.
References bio_earplugs, bio_ears, effect_deaf, flag_DEAF(), flag_FUNGUS(), Creature::get_effect_int(), get_map(), has_active_bionic(), map::has_flag_ter_or_furn(), has_trait(), in_sleep_state(), pos(), trait_DEAF, trait_M_SKIN3, and worn_with_flag().
Referenced by iuse::artifact(), iuse::bell(), can_hear(), game::do_turn(), draw_lighting_classic(), draw_sound_labels(), draw_sound_narrow(), draw_stealth(), dialogue::dynamic_line(), avatar::get_book_reader(), sounds::process_sound_markers(), iexamine::safe(), suffer_from_bad_bionics(), and wear_item().
|
overridevirtual |
Returns true is the player is protected from electric shocks.
Implements Creature.
Definition at line 6191 of file character.cpp.
References DT_ELECTRIC, and is_immune_damage().
Referenced by iuse::ehandcuffs(), is_immune_field(), and map::player_in_field().
| bool Character::is_hauling | ( | ) | const |
Definition at line 9184 of file character.cpp.
References hauling.
Referenced by cancel_activity(), haul(), game::place_player(), avatar::set_movement_mode(), game::vertical_move(), and game::walk_move().
| bool Character::is_hibernating | ( | ) | const |
Returns if the player has hibernation mutation and is asleep and well fed.
Definition at line 5143 of file character.cpp.
References effect_sleep, get_kcal_percent(), get_thirst(), has_active_mutation(), Creature::has_effect(), trait_HIBERNATE, and very_thirsty.
Referenced by calc_needs_rates(), and update_needs().
|
overridevirtual |
Returns true if the player is immune to this kind of damage.
Implements Creature.
Definition at line 6218 of file character.cpp.
References AEP_RESIST_ELECTRICITY, bio_faraday, DT_ACID, DT_BASH, DT_BIOLOGICAL, DT_BULLET, DT_COLD, DT_CUT, DT_ELECTRIC, DT_HEAT, DT_NULL, DT_STAB, DT_TRUE, has_active_bionic(), has_artifact_with(), Creature::has_effect_with_flag(), has_trait(), trait_ACIDPROOF, trait_M_SKIN2, trait_M_SKIN3, and worn_with_flag().
Referenced by player::immune_to(), is_elec_immune(), and is_immune_effect().
|
overridevirtual |
Returns true if the player is immune to this kind of effect.
Implements Creature.
Definition at line 6196 of file character.cpp.
References bio_ears, DT_ACID, DT_HEAT, effect_bleed, effect_corroding, effect_deaf, effect_downed, effect_nausea, effect_onfire, flag_DEAF(), flag_PARTIAL_DEAF(), footwear_factor(), has_bionic(), has_trait(), is_immune_damage(), is_throw_immune(), is_wearing(), itype_rm13_armor_on, mutation_value(), trait_LEG_TENT_BRACE, trait_SLIMY, trait_STRONGSTOMACH, trait_VISCOUS, and worn_with_flag().
Referenced by sounds::process_sound_markers().
|
overridevirtual |
Returns true if we are immune to the field type with the given fid.
Does not handle intensity, so this function should only be called through is_dangerous_field().
Reimplemented from Creature.
Definition at line 6150 of file character.cpp.
References bio_heatsink, convert_bp(), DT_ACID, get_armor_type(), get_env_resist(), field_type::has_acid, has_active_bionic(), field_type::has_elec, field_type::has_fire, has_trait(), string_id< T >::id(), field_type::immunity_data_body_part_env_resistance, field_type::immunity_data_traits, is_elec_immune(), Creature::is_immune_field(), is_on_ground(), is_wearing(), itype_rm13_armor_on, int_id< T >::obj(), and trait_DEBUG_NODMG.
| bool Character::is_invisible | ( | ) | const |
Definition at line 6349 of file character.cpp.
References AEP_INVISIBLE, flag_EFFECT_INVISIBLE(), has_artifact_with(), Creature::has_effect_with_flag(), has_trait(), is_wearing_active_optcloak(), and trait_DEBUG_CLOAK.
Referenced by visibility().
| bool Character::is_limb_broken | ( | const bodypart_id & | limb | ) | const |
Returns true if the limb is broken.
Definition at line 1324 of file character.cpp.
References Creature::get_part_hp_cur().
Referenced by npc::adjust_worn(), iexamine::autodoc(), body_window(), character_martial_arts::can_arm_block(), can_wear(), draw_limb_health(), get_working_leg_count(), player::hardcoded_effects(), heal(), mend(), item::on_wear(), pick_part_to_heal(), and npc::wear_if_wanted().
| bool Character::is_limb_disabled | ( | const bodypart_id & | limb | ) | const |
Returns true if the limb is disabled(12.5% or less hp)
Definition at line 1317 of file character.cpp.
References Creature::get_part_hp_cur(), and Creature::get_part_hp_max().
Referenced by best_shield(), and get_working_arm_count().
| bool Character::is_limb_hindered | ( | hp_part | limb | ) | const |
Returns true if the limb is hindered(40% or less hp)
| bool Character::is_max_power | ( | ) | const |
Definition at line 2004 of file character.cpp.
References max_power_level, and power_level.
Referenced by feed_furnace_with().
| bool Character::is_mounted | ( | ) | const |
Definition at line 1143 of file character.cpp.
References effect_riding, Creature::has_effect(), and mounted_creature.
Referenced by activate_bionic(), cata_event_dispatch::avatar_moves(), best_nearby_lifting_assist(), iuse::blood_draw(), iuse::boltcutters(), iuse::burrow(), can_install_bionics(), map::can_move_furniture(), cauterize_actor::can_use(), enzlave_actor::can_use(), musical_instrument_actor::can_use(), install_bionic_actor::can_use(), repair_item_actor::can_use_tool(), player::can_wield(), iuse::capture_monster_act(), iuse::capture_monster_veh(), debug_menu::character_edit_menu(), check_mount_is_spooked(), check_mount_will_move(), iuse::chop_logs(), iuse::chop_tree(), iuse::clear_rubble(), iuse::craft(), iuse::crowbar(), iuse::cut_log_into_planks(), npc::die(), iuse::dig(), iuse::dig_channel(), iuse::disassemble(), dismount(), game::do_turn(), iuse::einktabletpc(), game::examine(), iuse::fill_pit(), player::fire_gun(), iuse::fish_trap(), iuse::fishing_rod(), iuse::gun_repair(), ranged::gunmode_checks_weapon(), iuse::hacksaw(), iuse::hairkit(), iuse::hammer(), game::handle_action(), has_charges(), iuse::jackhammer(), iuse::ladder(), player::list_ammo(), iuse::lumber(), iuse::makemound(), iuse::meditate(), melee_attack(), iuse::mind_splicer(), mine_activity(), iuse::mop(), avatar_action::move(), npc::move_to(), game::npc_menu(), game::on_move_effects(), overmap_sight_range(), iuse::oxytorch(), perform_technique(), iuse::pickaxe(), npc::place_on_map(), game::place_player(), game::place_player_overmap(), avatar_action::plthrow(), iuse::portable_game(), iuse::portal(), game::prompt_dangerous_tile(), recalc_sight_limits(), player::reset_stats(), iuse::rpgdie(), run_cost(), avatar::set_movement_mode(), iuse::shavekit(), iuse::siphon(), sleep(), smash(), store(), avatar_action::swim(), swim_speed(), iuse::teleport(), player::throw_item(), throw_range(), trapfunc::tripwire(), iuse::unfold_generic(), unfold_vehicle_iuse::use(), pick_lock_actor::use(), deploy_furn_actor::use(), cauterize_actor::use(), enzlave_actor::use(), musical_instrument_actor::use(), heal_actor::use(), place_trap_actor::use(), deploy_tent_actor::use(), sew_advanced_actor::use(), weigh_self_actor::use(), use_charges(), game::vertical_move(), iuse::vibe(), game::walk_move(), iuse::wash_hard_items(), wash_items(), iuse::wash_soft_items(), iuse::water_purifier(), weight_capacity(), and npc::worker_downtime().
|
overridevirtual |
Returns true if the player is knocked over or has broken legs.
Implements Creature.
Definition at line 962 of file character.cpp.
References effect_downed, get_working_leg_count(), and Creature::has_effect().
Referenced by is_immune_field(), map::player_in_field(), and game::walk_move().
| bool Character::is_quiet | ( | ) | const |
Returns true if the player has quiet melee attacks.
Definition at line 1182 of file martialarts.cpp.
References b, Creature::effects, and search_ma_buff_effect().
Referenced by melee_attack().
| bool Character::is_rad_immune | ( | ) | const |
Returns true if the player is protected from radiation.
Definition at line 6261 of file character.cpp.
References is_wearing_power_armor(), and worn_with_flag().
Referenced by irradiate(), and suffer_from_radiation().
| std::string Character::is_snuggling | ( | ) | const |
Checks to see if the player is using floor items to keep warm, and return the name of one such item if so.
Definition at line 9325 of file character.cpp.
References item_stack::begin(), bp_leg_l, bp_leg_r, bp_torso, item_stack::empty(), item_stack::end(), vehicle::get_items(), get_map(), map::i_at(), in_vehicle, pos(), item::type_name(), map::veh_at(), vehicle::vehicle(), and VPFLAG_CARGO.
Referenced by fall_asleep().
| bool Character::is_throw_immune | ( | ) | const |
Returns true if the player is immune to throws.
Definition at line 1176 of file martialarts.cpp.
References b, Creature::effects, and search_ma_buff_effect().
Referenced by mattack::bio_op_takedown(), mattack::grab(), is_immune_effect(), mattack::thrown_by_judo(), and game::update_stair_monsters().
|
private |
Check whether the other creature is in range and can be seen by this creature.
| critter | Creature to check for visibility |
| range | The maximal distance (rl_dist), creatures at this distance or less are included. |
Definition at line 10217 of file character.cpp.
References Creature::pos(), pos(), rl_dist(), and sees().
|
overridevirtual |
Reimplemented from Creature.
Definition at line 508 of file character.cpp.
| bool Character::is_waterproof | ( | const body_part_set & | parts | ) | const |
Definition at line 8995 of file character.cpp.
References covered_with_flag().
Referenced by drench().
| bool Character::is_weak_to_water | ( | ) | const |
| bool Character::is_wearing | ( | const item & | itm | ) | const |
Returns true if the player is wearing the item.
Definition at line 3240 of file character.cpp.
References worn.
Referenced by apply_persistent_morale(), iexamine::cardreader_foodplace(), drop(), get_shout_volume(), is_immune_effect(), is_immune_field(), game_menus::inv::multidrop(), mattack::nurse_assist(), map::player_in_field(), avatar_action::plthrow(), examine_item_menu::rate_action_wear(), recalc_sight_limits(), examine_item_menu::run(), conditional_t< T >::set_is_wearing(), shout(), npc::talk_to_u(), update_bodytemp(), iuse::vibe(), and game::walk_move().
| bool Character::is_wearing | ( | const itype_id & | it | ) | const |
Returns true if the player is wearing an item of this type.
Definition at line 3250 of file character.cpp.
References worn.
| bool Character::is_wearing_active_optcloak | ( | ) | const |
Returns true if the player is wearing an active optical cloak.
Definition at line 3818 of file character.cpp.
References flag_ACTIVE_CLOAKING(), and worn.
Referenced by player::basic_symbol_color(), and is_invisible().
| bool Character::is_wearing_active_power_armor | ( | ) | const |
Returns true if the character is wearing active power.
Definition at line 3808 of file character.cpp.
References flag_POWERARMOR_EXO(), and worn.
| bool Character::is_wearing_helmet | ( | ) | const |
Returns true if the character is wearing something occupying the helmet slot.
Definition at line 8898 of file character.cpp.
References bp_head, flag_AURA(), flag_HELMET_COMPAT(), flag_OVERSIZE(), flag_PERSONAL(), flag_SEMITANGIBLE(), flag_SKINTIGHT(), and worn.
Referenced by can_wear().
| bool Character::is_wearing_on_bp | ( | const itype_id & | it, |
| const bodypart_id & | bp | ||
| ) | const |
Returns true if the player is wearing the item on the given body part.
Definition at line 3260 of file character.cpp.
References worn.
Referenced by shoe_type_count().
| bool Character::is_wearing_power_armor | ( | bool * | hasHelmet = nullptr | ) | const |
Returns true if the character is wearing power armor.
Definition at line 3783 of file character.cpp.
References bp_head, flag_POWERARMOR_EXO(), and worn.
Referenced by can_wear(), irradiate(), is_rad_immune(), power_rating(), and suffer_from_radiation().
| bool Character::is_wearing_shoes | ( | const side & | which_side = side::BOTH | ) | const |
Returns true if the player is wearing something on their feet that is not SKINTIGHT.
Definition at line 8869 of file character.cpp.
References BOTH, bp_foot_l, bp_foot_r, flag_AURA(), flag_BELTED(), flag_PERSONAL(), flag_SEMITANGIBLE(), flag_SKINTIGHT(), LEFT, left, RIGHT, right, and worn.
Referenced by can_wear(), rooted_message(), and suffer_from_other_mutations().
| bool Character::is_wielding | ( | const item & | target | ) | const |
Definition at line 3235 of file character.cpp.
References weapon.
Referenced by player::consume(), convert_to_items(), drop(), enchantment::is_active(), game_menus::inv::multidrop(), avatar_action::plthrow(), avatar_action::reload_weapon(), pickup::reorder_for_dropping(), examine_item_menu::run(), iuse_transform::use(), holster_actor::use(), bandolier_actor::use(), cast_spell_actor::use(), player::weapon_value(), avatar::wield(), and avatar_action::wield().
|
inline |
Definition at line 1082 of file character.h.
References mdeath::thing(), and worn.
Referenced by inventory_selector::add_character_items(), detach_gunmods_actor::can_use(), change_side(), check_art_charge_req(), player::consume(), convert_to_items(), item_location::impl::item_on_person::describe(), iuse::directional_hologram(), iuse::dive_tank(), iuse::gasmask(), get_dependent_worn_items(), item::get_encumber(), enchantment::is_active(), wear_inventory_preset::is_shown(), take_off_inventory_preset::is_shown(), steal_inventory_preset::is_shown(), pickup::obtain_and_tokenize_items(), item_location::impl::item_on_person::obtain_cost(), on_worn_item_washed(), game::process_artifact(), examine_item_menu::rate_action_change_side(), examine_item_menu::rate_action_takeoff(), pickup::reorder_for_dropping(), player::select_ammo(), iuse::solarpack(), iuse::solarpack_off(), iuse_transform::use(), holster_actor::use(), cast_spell_actor::use(), player::wear(), avatar::wield(), and avatar_action::wield().
|
protected |
Applies encumbrance from items only If new_item is not null, then calculate under the asumption that it is added to existing work items.
Definition at line 3958 of file character.cpp.
References all_body_parts, encumbrance_data::armor_encumbrance, char_encumbrance_data::elems, encumbrance_data::encumbrance, detail::fill(), item::is_null(), layer_item(), encumbrance_data::layer_penalty, PERSONAL_LAYER, position_to_wear_new_item(), and worn.
Referenced by calc_encumbrance().
| int Character::item_handling_cost | ( | const item & | it, |
| bool | penalties = true, |
||
| int | base_cost = INVENTORY_HANDLING_PENALTY |
||
| ) | const |
Calculate (but do not deduct) the number of moves required when handling (e.g.
storing, drawing etc.) an item
| it | Item to calculate handling cost for |
| penalties | Whether item volume and temporary effects (e.g. GRABBED, DOWNED) should be considered. |
| base_cost | Cost due to storage type. |
Definition at line 7572 of file character.cpp.
References bp_hand_l, bp_hand_r, effect_grabbed, encumb(), Creature::has_effect(), item::is_two_handed(), itype_e_handcuffs, MAX_HANDLING_COST, item::typeId(), item::volume(), and weapon.
Referenced by dispose_item(), npc::dispose_item(), throw_activity_actor::do_turn(), player::item_reload_cost(), item_store_cost(), item_wear_cost(), mill_activate(), mill_load_food(), iexamine::quern_examine(), smoker_activate(), smoker_load_food(), iexamine::smoker_options(), player::unload(), avatar::wield(), and player::wield_contents().
| int Character::item_store_cost | ( | const item & | it, |
| const item & | container, | ||
| bool | penalties = true, |
||
| int | base_cost = INVENTORY_HANDLING_PENALTY |
||
| ) | const |
Calculate (but do not deduct) the number of moves required when storing an item in a container.
| it | Item to calculate storage cost for |
| container | Container to store item in |
| penalties | Whether item volume and temporary effects (e.g. GRABBED, DOWNED) should be considered. |
| base_cost | Cost due to storage type. |
Definition at line 7596 of file character.cpp.
References get_skill_level(), item::gun_skill(), item::is_gun(), item_handling_cost(), and item::melee_skill().
Referenced by dispose_item(), npc::dispose_item(), and player::store().
| int Character::item_wear_cost | ( | const item & | it | ) | const |
Calculate (but do not deduct) the number of moves required to wear an item.
Definition at line 7611 of file character.cpp.
References AURA_LAYER, BELTED_LAYER, item::get_encumber(), item::get_layer(), item_handling_cost(), OUTER_LAYER, PERSONAL_LAYER, REGULAR_LAYER, UNDERWEAR_LAYER, and WAIST_LAYER.
Referenced by dispose_item(), and wear_item().
| item & Character::item_with_best_of_quality | ( | const quality_id & | qid | ) |
Returns the item in the player's inventory with the highest of the specified quality.
Definition at line 10001 of file character.cpp.
References item::get_quality(), visitable< T >::has_quality(), visitable< Character >::items_with(), visitable< Character >::max_quality(), and null_item_reference().
| const item * Character::item_worn_with_flag | ( | const std::string & | flag, |
| const bodypart_id & | bp = bodypart_str_id::NULL_ID() |
||
| ) | const |
Returns the first worn item with a given flag.
Definition at line 3278 of file character.cpp.
References string_id< body_part_type >::NULL_ID(), and worn.
Referenced by burn_fuel().
| bool Character::knows_recipe | ( | const recipe * | rec | ) | const |
Definition at line 10573 of file character.cpp.
References recipe_subset::contains(), and get_learned_recipes().
Referenced by complete_craft(), crafting::complete_disassemble(), avatar::create(), avatar::do_read(), find_repair_difficulty(), read_inventory_preset::get_known_recipes(), player::has_recipe(), select_crafting_recipe(), conditional_t< T >::set_u_know_recipe(), skim_book_msg(), and player::studied_all_recipes().
| bool Character::knows_trap | ( | const tripoint & | pos | ) | const |
Definition at line 10241 of file character.cpp.
References get_map(), map::getabs(), known_traps, and pos().
Referenced by trap::can_see(), vehicle::handle_trap(), and player::search_surroundings().
| int Character::leak_level | ( | const std::string & | flag | ) | const |
Definition at line 1967 of file suffer.cpp.
References inv, leak_level(), and inventory::leak_level().
Referenced by iexamine::autodoc(), iuse::geiger(), leak_level(), and suffer_from_radiation().
| void Character::learn_recipe | ( | const recipe * | rec | ) |
Definition at line 10578 of file character.cpp.
References learned_recipes, and recipe::never_learn.
Referenced by debug_menu::character_edit_menu(), complete_craft(), crafting::complete_disassemble(), avatar::create(), and avatar::do_read().
| nc_color Character::limb_color | ( | const bodypart_id & | bp, |
| bool | bleed, | ||
| bool | bite, | ||
| bool | infect | ||
| ) | const |
Definition at line 6057 of file character.cpp.
References Creature::bleed(), c_blue, c_green, c_light_gray, c_magenta, c_red, c_yellow, effect_bite, effect_bleed, effect_infected, and Creature::has_effect().
Referenced by body_window(), draw_health_classic(), draw_limb2(), draw_limb_narrow(), draw_limb_wide(), and extended_description().
|
protected |
Gather variables for saving.
These variables are common to both the avatar and NPCs.
Definition at line 387 of file savegame_json.cpp.
References _skills, activity, activity_vehicle_part_index, vitamin::all(), JsonObject::allow_omitted_members(), assign(), auto_move_route, autolearn_skills_stamp, backlog, body_wetness, string_id< T >::c_str(), cached_mutations, clamp(), inventory::clear(), consumption_history, custom_profession, damage_bandaged, damage_disinfected, debugmsg, destination_activity, dex_bonus, dex_cur, dex_max, effect_riding, Creature::effects, fatigue, frostbite_timer, g, profession::generic(), JsonObject::get_array(), effect::get_bp(), effect::get_id(), JsonObject::get_int(), effect::get_intensity(), JsonObject::get_object(), Creature::get_perceived_pain(), JsonObject::get_raw(), JsonObject::has_array(), Creature::has_effect(), JsonObject::has_member(), JsonArray::has_more(), healed_total, healthy, healthy_mod, player_activity::id(), init_age, init_height, int_bonus, int_cur, int_max, inv, string_id< T >::is_valid(), inventory::json_load_items(), known_traps, learned_recipes, Creature::load(), magic, martial_arts_data, matype_id, max_power_level, mapgen_defer::member, morale, mounted_creature, mounted_creature_id, move_mode, my_bionics, my_mutations, my_traits, name, string_id< T >::obj(), omt_path, on_effect_int_change(), on_item_wear(), on_mutation_gain(), on_stat_change(), overmap_time, oxygen, per_bonus, per_cur, per_max, pkill, position, power_level, prof, radiation, JsonObject::read(), JsonArray::read_next(), recalc_sight_limits(), recalculate_size(), reset_encumbrance(), requirement_data::save_requirement(), Creature::set_anatomy(), Creature::set_body(), Creature::set_part_hp_cur(), Creature::set_part_hp_max(), skill_id, sleep_deprivation, stamina, calendar::start_of_cataclysm, stashed_outbounds_activity, stashed_outbounds_backlog, stim, stomach, stored_calories, str_bonus, str_cur, str_max, temp_conv, temp_cur, thirst, type_of_scent, Creature::underwater, vitamin_levels, weapon, worn, tripoint::x, tripoint::y, and tripoint::z.
Referenced by monster::deserialize(), avatar::deserialize(), npc::deserialize(), and player::load().
| int Character::mabuff_armor_bonus | ( | damage_type | type | ) | const |
Returns the armor bonus against given type from martial arts buffs.
Definition at line 1130 of file martialarts.cpp.
References accumulate_ma_buff_effects(), b, Creature::effects, effect::get_intensity(), cata::hash64_detail::ret, and type.
Referenced by passive_absorb_hit().
| int Character::mabuff_arpen_bonus | ( | damage_type | type | ) | const |
Returns the arpen bonus from martial arts buffs.
Definition at line 1122 of file martialarts.cpp.
References accumulate_ma_buff_effects(), b, Creature::effects, effect::get_intensity(), cata::hash64_detail::ret, and type.
Referenced by roll_bash_damage(), roll_cut_damage(), and roll_stab_damage().
| float Character::mabuff_attack_cost_mult | ( | ) | const |
Returns the multiplier on move cost of attacks.
Definition at line 1164 of file martialarts.cpp.
References accumulate_ma_buff_effects(), b, Creature::effects, effect::get_intensity(), MOVE_COST, and cata::hash64_detail::ret.
Referenced by attack_cost().
| int Character::mabuff_attack_cost_penalty | ( | ) | const |
Returns the flat penalty to move cost of attacks.
If negative, that's a bonus. Applied after multiplier.
Definition at line 1156 of file martialarts.cpp.
References accumulate_ma_buff_effects(), b, Creature::effects, effect::get_intensity(), MOVE_COST, and cata::hash64_detail::ret.
Referenced by attack_cost().
| int Character::mabuff_block_bonus | ( | ) | const |
Returns the block bonus from martial arts buffs.
Definition at line 1106 of file martialarts.cpp.
References accumulate_ma_buff_effects(), b, Creature::effects, effect::get_intensity(), and cata::hash64_detail::ret.
Referenced by block_hit().
| int Character::mabuff_damage_bonus | ( | damage_type | type | ) | const |
Returns the flat damage bonus to given type from martial arts buffs, applied after the multiplier.
Definition at line 1148 of file martialarts.cpp.
References accumulate_ma_buff_effects(), b, Creature::effects, effect::get_intensity(), cata::hash64_detail::ret, and type.
Referenced by roll_bash_damage(), roll_cut_damage(), and roll_stab_damage().
| float Character::mabuff_damage_mult | ( | damage_type | type | ) | const |
Returns the damage multiplier to given type from martial arts buffs.
Definition at line 1138 of file martialarts.cpp.
References accumulate_ma_buff_effects(), b, Creature::effects, effect::get_intensity(), cata::hash64_detail::ret, and type.
Referenced by roll_bash_damage(), roll_cut_damage(), and roll_stab_damage().
| float Character::mabuff_dodge_bonus | ( | ) | const |
Returns the dodge bonus from martial arts buffs.
Definition at line 1098 of file martialarts.cpp.
References accumulate_ma_buff_effects(), b, Creature::effects, effect::get_intensity(), and cata::hash64_detail::ret.
Referenced by player::reset_stats().
| int Character::mabuff_speed_bonus | ( | ) | const |
Returns the speed bonus from martial arts buffs.
Definition at line 1114 of file martialarts.cpp.
References accumulate_ma_buff_effects(), b, Creature::effects, effect::get_intensity(), and cata::hash64_detail::ret.
Referenced by player::recalc_speed_bonus().
| float Character::mabuff_tohit_bonus | ( | ) | const |
Returns the to hit bonus from martial arts buffs.
Definition at line 1090 of file martialarts.cpp.
References accumulate_ma_buff_effects(), b, Creature::effects, and cata::hash64_detail::ret.
Referenced by get_melee_hit_base().
|
overridevirtual |
Implements Creature.
Definition at line 6313 of file character.cpp.
References detail::find(), and fleshy.
|
overridevirtual |
Implements Creature.
Definition at line 6318 of file character.cpp.
References fleshy, and coords::ms.
| int Character::max_stored_kcal | ( | ) | const |
Definition at line 4317 of file character.cpp.
Referenced by npc::address_needs(), burn_fuel(), can_drink_nectar(), debug_menu::character_edit_menu(), consume_effects(), npc::consume_food(), npc::consume_food_from_camp(), debug_menu::debug(), npc::decide_needs(), avatar_action::eat_here(), eff_fun_bloated(), player::environmental_revert_effect(), fall_asleep(), get_hunger_description(), get_kcal_percent(), player::hardcoded_effects(), marloss_common(), mend(), process_bionic(), player::process_one_effect(), npc::process_turn(), conditional_t< T >::set_need(), set_stored_kcal(), suffer_while_awake(), update_stomach(), npc::value(), and will_eat().
Checks whether the character meets overall requirements to be able to use the item.
Definition at line 3464 of file character.cpp.
References item::is_null(), meets_skill_requirements(), meets_stat_requirements(), itype::min_skills, and item::type.
Referenced by can_use(), gunmod_inventory_preset::get_denial(), and item::gun_range().
| bool Character::meets_skill_requirements | ( | const construction & | con | ) | const |
Checks whether the character's skills meet the required.
Definition at line 3448 of file character.cpp.
References construction::required_skills.
| bool Character::meets_skill_requirements | ( | const std::map< skill_id, int > & | req, |
| const item & | context = item() |
||
| ) | const |
Checks whether the character's skills meet the required.
Definition at line 3442 of file character.cpp.
References _skills.
Referenced by activity_handlers::build_do_turn(), can_learn_by_disassembly(), find_base_construction(), get_learned_recipes(), meets_requirements(), and player_can_build().
| bool Character::meets_stat_requirements | ( | const item & | it | ) | const |
Checks whether the character's stats meets the stats required by the item.
Definition at line 3456 of file character.cpp.
References flag_STR_DRAW(), get_dex(), get_int(), item::get_min_str(), get_per(), get_str(), item::has_flag(), itype::min_dex, itype::min_int, itype::min_per, and item::type.
Referenced by meets_requirements().
| void Character::melee_attack | ( | Creature & | t, |
| bool | allow_special | ||
| ) |
Calls the to other melee_attack function with an empty technique id (meaning no specific technique should be used).
Definition at line 382 of file melee.cpp.
References melee_attack().
| void Character::melee_attack | ( | Creature & | t, |
| bool | allow_special, | ||
| const matec_id & | force_technique, | ||
| bool | allow_unarmed = true |
||
| ) |
Sets up a melee attack and handles melee attack function calls.
| t | Creature to attack |
| allow_special | whether non-forced martial art technique or mutation attack should be possible with this attack. |
| force_technique | special technique to use in attack. |
| allow_unarmed | always uses the wielded weapon regardless of martialarts style |
Definition at line 390 of file melee.cpp.
References _, melee_statistic_data::actual_crit_count, Creature::add_effect(), add_msg(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), AEP_SAP_LIFE, Creature::as_character(), item::attack_cost(), attack_cost(), melee_statistic_data::attack_count, ma_technique::avatar_message, bio_cqb, bp_arm_l, bp_arm_r, can_miss_recovery(), Creature::check_dead_state(), sounds::combat, melee_statistic_data::damage_amount, Creature::deal_melee_attack(), Creature::deal_melee_hit(), did_hit(), Creature::disp_name(), Creature::dodge_roll(), DT_CUT, DT_STAB, effect_badpoison, effect_hit_by_player, effect_poison, encumb(), g, sfx::generate_melee_sound(), get_miss_reason(), get_skill_level(), get_working_arm_count(), has_active_bionic(), has_artifact_with(), item::has_flag(), has_trait(), healall(), melee_statistic_data::hit_count, hit_roll(), ma_technique::id, Creature::is_dead_state(), Creature::is_monster(), is_mounted(), item::is_null(), Creature::is_player(), is_quiet(), m_bad, m_debug, m_good, m_info, m_neutral, monster::made_of(), martial_arts_data, melee_message(), melee_special_effects(), melee::melee_stats, melee_train(), mapgen_defer::message, MF_RIDEABLE_MECH, Creature::mod_moves(), mod_stamina(), mounted_creature, move_cost(), damage_instance::mult_damage(), name, string_id< T >::obj(), on_hit(), one_in(), perform_special_attacks(), perform_technique(), pick_technique(), player_hit_message(), Creature::pos(), pos(), reach_attacking, item::reach_range(), rng(), roll_all_damage(), roll_remainder(), scored_crit(), skill_melee, mattack::smash_specific(), sounds::sound(), string_id< T >::str(), stumble(), tec_none, dealt_damage_instance::total_damage(), trait_DEFT, trait_POISONOUS, trait_POISONOUS2, dealt_damage_instance::type_damage(), used_weapon(), weapon, and item::weight().
Referenced by block_hit(), npc::execute_action(), melee_attack(), monexamine::mfriend_menu(), avatar_action::move(), npc::move_to(), game::npc_menu(), player::on_dodge(), perform_technique(), monexamine::pet_menu(), and player::reach_attack().
| std::string Character::melee_special_effects | ( | Creature & | t, |
| damage_instance & | d, | ||
| item & | weap | ||
| ) |
Handles combat effects, returns a string of any valid combat effect messages.
Strength increases chance of breaking glass weapons (NEGATIVE)Definition at line 1815 of file melee.cpp.
References _, damage_instance::add_damage(), Creature::add_msg_if_npc(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), bionic_id, sounds::combat, item::conductive(), item::contents, item::damage_melee(), deal_damage(), Creature::disp_name(), DT_COLD, DT_CUT, DT_ELECTRIC, DT_HEAT, get_power_level(), handle_melee_wear(), has_active_bionic(), item::has_flag(), is_armed(), Creature::is_hallucination(), Creature::is_player(), item::is_two_handed(), Creature::is_warm(), m_bad, item::made_of(), martial_arts_data, mod_power_level(), damage_instance::physical(), pos(), remove_weapon(), rng(), sounds::sound(), item_contents::spill_contents(), str_cur, string_format(), item::tname(), item::volume(), weapon, and x_in_y().
Referenced by melee_attack().
| void Character::mend | ( | int | rate_multiplier | ) |
Handles the chance for broken limbs to spontaneously heal to 1 HP.
Definition at line 1602 of file suffer.cpp.
References _, Creature::add_effect(), add_msg(), Creature::add_msg_if_player(), addiction_level(), addiction_scaling(), ALCOHOL, body_part_name(), broken, broken_bone_mends, CIG, clamp(), dead_tired, effect_cig, effect_drunk, effect_mending, effect_sleep, g, Creature::get_all_body_parts(), Creature::get_effect(), get_fatigue(), get_healthy(), get_rad(), get_stored_kcal(), get_thirst(), getID(), Creature::has_effect(), has_trait(), is_limb_broken(), m_debug, m_good, max_stored_kcal(), mutation_value(), parched, Creature::remove_effect(), rest_quality(), roll_remainder(), Creature::set_part_hp_cur(), trait_RADIOGENIC, trait_REGEN_LIZ, very_thirsty, and worn_with_flag().
Referenced by update_body().
| float Character::metabolic_rate | ( | ) | const |
Current metabolic rate due to traits, hunger, speed, etc.
Definition at line 607 of file consumption.cpp.
References metabolic_rate_base().
Referenced by calc_needs_rates().
| float Character::metabolic_rate_base | ( | ) | const |
Stable base metabolic rate due to traits.
Definition at line 594 of file consumption.cpp.
References bonus_from_enchantments(), enchant_vals::METABOLISM, and mutation_value().
Referenced by bmr(), and metabolic_rate().
| void Character::mod_base_age | ( | int | mod | ) |
Definition at line 6896 of file character.cpp.
References init_age.
Referenced by set_description().
| void Character::mod_base_height | ( | int | mod | ) |
Definition at line 6925 of file character.cpp.
References init_height.
Referenced by set_description().
|
virtual |
Definition at line 4179 of file character.cpp.
References dex_bonus, dex_cur, and dex_max.
Referenced by enchantment::activate_passive(), addict_effect(), temperature_effect::apply(), eff_fun_hallu(), player::hardcoded_effects(), mod_stat(), game::process_artifact(), reset_stats(), player::reset_stats(), and suffer_in_sunlight().
|
virtual |
Definition at line 4430 of file character.cpp.
References fatigue, and set_fatigue().
Referenced by addict_effect(), activity_handlers::burrow_finish(), check_needs_extremes(), activity_handlers::chop_logs_finish(), activity_handlers::chop_tree_do_turn(), activity_handlers::fill_pit_finish(), dig_activity_actor::finish(), dig_channel_activity_actor::finish(), iexamine::flower_poppy(), iuse::flusleep(), activity_handlers::hacksaw_finish(), activity_handlers::hand_crank_do_turn(), player::hardcoded_effects(), iuse::inhaler(), activity_handlers::jackhammer_finish(), marloss_common(), iuse::meth(), player::mod_stat(), modify_fatigue(), mutation_spend_resources(), iuse::mycus(), activity_handlers::pickaxe_finish(), game::process_artifact(), player::process_one_effect(), iuse::purify_iv(), spell_effect::recover_energy(), iuse::sleep(), activity_handlers::spellcasting_finish(), iuse::stimpack(), suffer_from_bad_bionics(), suffer_from_chemimbalance(), suffer_from_stimulants(), suffer_mutation_power(), iuse::thorazine(), update_needs(), mutagen_actor::use(), mutagen_iv_actor::use(), activity_handlers::vibe_do_turn(), and game::walk_move().
|
virtual |
Modifiers for health values exclusive to characters.
Definition at line 4246 of file character.cpp.
References get_mutations(), and healthy.
Referenced by iuse::adrenaline_injector(), mod_stat(), player::process_one_effect(), spell_effect::recover_energy(), and update_health().
|
virtual |
Definition at line 4258 of file character.cpp.
References healthy_mod.
Referenced by addict_effect(), iuse::blech(), check_needs_extremes(), consume_effects(), player::hardcoded_effects(), modify_health(), iuse::mycus(), iuse::plantblech(), player::process_one_effect(), rooted(), suffer_from_bad_bionics(), suffer_from_other_mutations(), update_health(), and iuse::vaccine().
|
virtual |
Definition at line 4189 of file character.cpp.
References int_bonus, int_cur, and int_max.
Referenced by enchantment::activate_passive(), addict_effect(), temperature_effect::apply(), eff_fun_hallu(), player::hardcoded_effects(), mod_stat(), game::process_artifact(), reset_stats(), player::reset_stats(), and suffer_in_sunlight().
| void Character::mod_max_power_level | ( | const units::energy & | npower_max | ) |
Definition at line 1999 of file character.cpp.
References max_power_level.
Referenced by activate_mutation(), add_bionic(), perform_uninstall(), and uninstall_bionic().
| void Character::mod_painkiller | ( | int | npkill | ) |
Modifies intensity of painkillers
Definition at line 9783 of file character.cpp.
References pkill, and set_painkiller().
Referenced by addict_effect(), iuse::jet_injector(), marloss_common(), iuse::mycus(), iuse::oxygen_bottle(), process_bionic(), player::process_one_effect(), iuse::stimpack(), suffer_from_chemimbalance(), suffer_from_schizophrenia(), and update_needs().
|
virtual |
Definition at line 4184 of file character.cpp.
References per_bonus, per_cur, and per_max.
Referenced by enchantment::activate_passive(), addict_effect(), temperature_effect::apply(), eff_fun_hallu(), player::hardcoded_effects(), mod_stat(), game::process_artifact(), reset_stats(), player::reset_stats(), and suffer_in_sunlight().
| void Character::mod_power_level | ( | const units::energy & | npower | ) |
Definition at line 1987 of file character.cpp.
References get_max_power_level(), get_power_level(), and set_power_level().
Referenced by activate_bionic(), activate_mutation(), burn_fuel(), npc::check_or_use_weapon_cbm(), deactivate_bionic(), npc::discharge_cbm_weapon(), do_skill_rust(), iuse::ehandcuffs(), explosion_handler::emp_blast(), feed_furnace_with(), aim_activity_actor::finish(), iexamine::fireplace(), hack_attempt(), melee_special_effects(), modify_morale(), game::monmove(), player::on_hit(), game::on_move_effects(), passive_power_gen(), game::phasing_move(), process_bionic(), player::process_turn(), npc::recharge_cbm(), spell_effect::recover_energy(), mattack::riotbot(), activity_handlers::spellcasting_finish(), suffer_from_asthma(), suffer_from_bad_bionics(), suffer_from_radiation(), suffer_while_underwater(), try_start_hacking(), player::uncanny_dodge(), update_stamina(), use_charges(), and use_fire().
| void Character::mod_rad | ( | int | mod | ) |
Definition at line 7186 of file character.cpp.
References get_rad(), has_trait_flag(), and set_rad().
Referenced by activate_bionic(), irradiate(), game::process_artifact(), player::process_one_effect(), regen(), and suffer_from_radiation().
| void Character::mod_skill_level | ( | const skill_id & | ident, |
| int | delta | ||
| ) |
Definition at line 3371 of file character.cpp.
References _skills.
Referenced by avatar::create(), npc::randomize(), and set_skills().
|
virtual |
Definition at line 4435 of file character.cpp.
References set_sleep_deprivation(), and sleep_deprivation.
Referenced by update_needs().
| void Character::mod_stamina | ( | int | mod | ) |
Definition at line 7213 of file character.cpp.
References clamp(), get_stamina_max(), Creature::is_npc(), and stamina.
Referenced by burn_move_stamina(), activity_handlers::butcher_do_turn(), cough(), aim_activity_actor::finish(), melee_attack(), player::mod_stat(), game::process_artifact(), player::process_one_effect(), activity_handlers::pulp_do_turn(), spell_effect::recover_energy(), smash(), activity_handlers::spellcasting_finish(), player::throw_item(), and update_stamina().
|
overridevirtual |
Reimplemented from Creature.
Reimplemented in player.
Definition at line 520 of file character.cpp.
References mod_dex_bonus(), mod_healthy(), mod_int_bonus(), mod_per_bonus(), Creature::mod_stat(), mod_stored_kcal(), and mod_str_bonus().
Referenced by apply_skill_boost(), player::mod_stat(), and shout().
| void Character::mod_stim | ( | int | mod | ) |
Definition at line 7171 of file character.cpp.
References stim.
Referenced by addict_effect(), alcohol(), do_skill_rust(), player::hardcoded_effects(), iuse::jet_injector(), iuse::mycus(), iuse::oxygen_bottle(), process_bionic(), player::process_one_effect(), iuse::prozac(), and iuse::stimpack().
|
virtual |
Modifiers for need values exclusive to characters.
Definition at line 4299 of file character.cpp.
References set_stored_kcal(), and stored_calories.
Referenced by alcohol(), iuse::blech(), burn_fuel(), consume_effects(), npc::consume_food_from_camp(), iuse::ecig(), eff_fun_fungus(), eff_fun_hallu(), dig_channel_activity_actor::finish(), basecamp::finish_return(), player::hardcoded_effects(), iuse::meth(), mod_stat(), mod_stored_nutr(), mutation_spend_resources(), iuse::plantblech(), game::process_artifact(), process_bionic(), player::process_one_effect(), iuse::smoking(), suffer_from_chemimbalance(), suffer_in_sunlight(), update_stomach(), mutagen_iv_actor::use(), iuse::weed_cake(), and weed_msg().
|
virtual |
Definition at line 4304 of file character.cpp.
References mod_stored_kcal().
Referenced by iuse::blood_draw(), activity_handlers::burrow_finish(), activity_handlers::chop_logs_finish(), activity_handlers::chop_tree_do_turn(), activity_handlers::fill_pit_finish(), game::find_or_make_stairs(), dig_activity_actor::finish(), activity_handlers::hacksaw_finish(), player::hardcoded_effects(), activity_handlers::jackhammer_finish(), marloss_common(), iuse::mycus(), activity_handlers::pickaxe_finish(), iuse::purify_iv(), suffer_mutation_power(), and mutagen_actor::use().
|
virtual |
Definition at line 4174 of file character.cpp.
References str_bonus, str_cur, and str_max.
Referenced by enchantment::activate_passive(), addict_effect(), temperature_effect::apply(), eff_fun_hallu(), player::hardcoded_effects(), mod_stat(), game::process_artifact(), reset_stats(), player::reset_stats(), suffer_from_bad_bionics(), and suffer_in_sunlight().
|
virtual |
Definition at line 4414 of file character.cpp.
References has_trait_flag(), set_thirst(), and thirst.
Referenced by iuse::blech(), iuse::blood_draw(), activity_handlers::burrow_finish(), activity_handlers::chop_logs_finish(), activity_handlers::chop_tree_do_turn(), consume_effects(), iuse::ecig(), eff_fun_fungus(), activity_handlers::fill_pit_finish(), game::find_or_make_stairs(), dig_activity_actor::finish(), dig_channel_activity_actor::finish(), activity_handlers::hacksaw_finish(), player::hardcoded_effects(), activity_handlers::jackhammer_finish(), marloss_common(), player::mod_stat(), mutation_spend_resources(), iuse::mycus(), activity_handlers::pickaxe_finish(), iuse::plantblech(), game::process_artifact(), process_bionic(), player::process_one_effect(), iuse::purify_iv(), rooted(), iuse::smoking(), suffer_from_chemimbalance(), suffer_from_other_mutations(), suffer_mutation_power(), suffer_while_underwater(), update_stomach(), mutagen_actor::use(), mutagen_iv_actor::use(), and iuse::weed_cake().
| void Character::modify_addiction | ( | const islot_comestible & | comest | ) |
Used to apply addiction modifications from food and medication.
Definition at line 1044 of file consumption.cpp.
References islot_comestible::add, add_addiction(), islot_comestible::addict, addiction_craving(), MORALE_NULL, and rem_morale().
Referenced by consume_effects(), and player::consume_med().
| void Character::modify_fatigue | ( | const islot_comestible & | comest | ) |
Used to apply fatigue modifications from food and medication.
Definition at line 1034 of file consumption.cpp.
References islot_comestible::fatigue_mod, and mod_fatigue().
Referenced by consume_effects(), and player::consume_med().
| void Character::modify_health | ( | const islot_comestible & | comest | ) |
Used to apply health modifications from food and medication.
Definition at line 991 of file consumption.cpp.
References islot_comestible::healthy, and mod_healthy_mod().
Referenced by consume_effects(), and player::consume_med().
| void Character::modify_morale | ( | item & | food, |
| int | nutr = 0 |
||
| ) |
Used to apply morale modifications from food and medication.
Definition at line 1052 of file consumption.cpp.
References _, add_morale(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), allergy, allergy_type(), bio_taste_blocker, iuse::chew(), comesttype_FOOD(), crafting_inventory(), crossed_threshold(), find_food_heater(), flag_ALLERGEN_JUNK(), flag_CANNIBALISM(), flag_CARNIVORE_OK(), flag_EATEN_HOT(), flag_HIDDEN_HALLU(), flag_URSINE_HONEY(), flag_USE_EAT_VERB(), units::from_kilojoule(), fun_for(), item::get_comestible(), get_map(), get_power_level(), has_active_bionic(), item::has_flag(), has_trait(), m_bad, m_good, mod_power_level(), MORALE_CANNIBAL, MORALE_FOOD_BAD, MORALE_FOOD_GOOD, MORALE_FOOD_HOT, MORALE_HONEY, MORALE_NO_DIGEST, MORALE_NULL, MORALE_SWEETTOOTH, mutation_category_level, one_in(), PICKUP_RANGE, pos(), item::rotten(), item::tname(), trait_CANNIBAL, trait_CARNIVORE, trait_PROJUNK, trait_PROJUNK2, trait_PSYCHOPATH, trait_SAPIOVORE, trait_SAPROPHAGE, trait_SPIRITUAL, trait_THRESH_URSINE, and item::type.
Referenced by consume_effects(), and player::consume_med().
| void Character::modify_radiation | ( | const islot_comestible & | comest | ) |
Used to apply radiation from food and medication.
Definition at line 1039 of file consumption.cpp.
References irradiate(), and islot_comestible::radiation.
Referenced by consume_effects(), and player::consume_med().
| void Character::modify_stimulation | ( | const islot_comestible & | comest | ) |
Used to apply stimulation modifications from food and medication.
Definition at line 999 of file consumption.cpp.
References _, islot_comestible::add, Creature::add_effect(), Creature::add_msg_if_player(), CAFFEINE, COKE, CRACK, effect_visuals, get_stim(), has_trait(), m_bad, random_entry_ref(), set_stim(), sgn(), SPEED, islot_comestible::stim, and trait_STIMBOOST.
Referenced by consume_effects(), and player::consume_med().
| void Character::mount_creature | ( | monster & | z | ) |
Definition at line 1033 of file character.cpp.
References _, Creature::add_effect(), monster::add_effect(), add_msg(), Creature::add_msg_if_player(), effect_harnessed, effect_ridden, effect_riding, effect_tied, Creature::facing, g, monster::get_name(), getID(), Creature::has_effect(), monster::has_flag(), i_add(), Creature::is_avatar(), string_id< T >::is_empty(), m_debug, m_good, m_info, m_warning, mtype::mech_weapon, MF_RIDEABLE_MECH, Creature::mod_moves(), mounted_creature, monster::mounted_player_id, num_bp, OBJECT_NONE, monster::pos(), recalc_sight_limits(), Creature::remove_effect(), npc::setpos(), monster::tied_item, monster::type, and wield().
Referenced by activity_handlers::find_mount_do_turn().
|
overridevirtual |
Processes effects which may prevent the Character from moving (bear traps, crushed, etc.).
Returns false if movement is stopped.
Strength increases chance to escape pit Dexterity increases chance to escape pit, slightlyImplements Creature.
Definition at line 1535 of file character.cpp.
References _, Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), effect_beartrap, effect_crushed, effect_downed, effect_grabbed, effect_heavysnare, effect_in_pit, effect_lightsnare, effect_webbed, get_dex(), get_str(), Creature::has_effect(), m_bad, m_good, Creature::remove_effect(), rng(), try_remove_bear_trap(), try_remove_crushed(), try_remove_downed(), try_remove_grab(), try_remove_heavysnare(), try_remove_lightsnare(), and try_remove_webs().
Referenced by avatar_action::move(), npc::move_to(), and game::vertical_move().
| bool Character::movement_mode_is | ( | character_movemode | mode | ) | const |
Check against the character's current movement mode.
Definition at line 1619 of file character.cpp.
References move_mode.
Referenced by avatar::cycle_move_mode(), draw_health_classic(), avatar_action::move(), move_mode_color(), move_mode_string(), game::on_move_effects(), Creature::sees(), game::vertical_move(), and game::walk_move().
|
protected |
Applies encumbrance from mutations and bionics only.
Definition at line 4021 of file character.cpp.
References apply_mut_encumbrance(), bio_shock_absorber, bp_eyes, char_encumbrance_data::elems, exclusive_flag_coverage(), flag_OVERSIZE(), get_bionics(), get_mutations(), and has_active_bionic().
Referenced by calc_encumbrance().
| void Character::mutate | ( | ) |
Picks a random valid mutation and gives it to the Character, possibly removing/changing others along the way.
Definition at line 845 of file mutation.cpp.
References weighted_list< W, T >::add(), Creature::add_msg_if_player(), effect_accumulated_mutagen, effect::get_duration(), Creature::get_effect(), effect::get_int_dur_factor(), has_trait(), m_debug, effect::mod_duration(), mutate_towards(), mutation_chances(), mutation_branch::name(), old_mutate(), weighted_list< W, T >::pick(), Creature::remove_effect(), remove_mutation(), and roll_remainder().
Referenced by iuse::artifact(), eff_fun_mutating(), player::hardcoded_effects(), marloss_common(), spell_effect::mutate(), mutate_category(), iuse::mycus(), mattack::science(), iuse::sewage(), suffer_from_artifacts(), suffer_from_other_mutations(), and suffer_from_radiation().
| void Character::mutate_category | ( | const std::string & | mut_cat | ) |
Picks a random valid mutation in a category and mutate_towards() it.
Definition at line 1044 of file mutation.cpp.
References has_trait(), mutate(), mutate_towards(), mutation_ok(), mutations_category, one_in(), trait_CHAOTIC_BAD, and trait_ROBUST.
Referenced by eff_fun_rat(), player::hardcoded_effects(), spell_effect::mutate(), iuse::mycus(), npc::randomize(), mutagen_actor::use(), and mutagen_iv_actor::use().
| bool Character::mutate_towards | ( | const trait_id & | mut | ) |
Mutates toward the entered mutation, upgrading or removing conflicts if necessary.
Definition at line 1113 of file mutation.cpp.
References _, Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), cancel, mutation_branch::cancels, drench_mut_calc(), evolves_mutation, detail::find(), g, gains_mutation, get_all_mutation_prereqs(), get_mutations_in_types(), getID(), has_base_trait(), has_child_flag(), has_trait(), mutation_branch::id, m_bad, m_good, m_mixed, m_neutral, mutation_branch::mixed_effect, mutate_towards(), mutation_branch::name(), string_id< mutation_branch >::NULL_ID(), string_id< T >::obj(), mutation_branch::points, mutation_branch::prereqs, mutation_branch::prereqs2, mutation_branch::profession, remove_child_flag(), remove_mutation(), same_type(), set_highest_cat_level(), set_mutation(), mutation_branch::threshold, mutation_branch::threshreq, mutation_branch::types, and unset_mutation().
| bool Character::mutate_towards | ( | std::vector< trait_id > | muts, |
| int | num_tries = INT_MAX |
||
| ) |
Mutates toward one of the given mutations, upgrading or removing conflicts if necessary.
Definition at line 1097 of file mutation.cpp.
References mutate_towards(), and rng().
Referenced by mutate(), spell_effect::mutate(), mutate_category(), mutate_towards(), old_mutate(), and debug_menu::wishmutate().
| resistances Character::mutation_armor | ( | bodypart_id | bp | ) | const |
Returns resistances on a body part provided by mutations.
Definition at line 6495 of file character.cpp.
References get_mutations().
Referenced by get_all_armor_type(), get_armor_bash_base(), get_armor_bullet_base(), get_armor_cut_base(), get_armor_type(), mutation_armor(), and passive_absorb_hit().
| float Character::mutation_armor | ( | bodypart_id | bp, |
| const damage_unit & | du | ||
| ) | const |
Definition at line 6510 of file character.cpp.
References resistances::get_effective_resist(), and mutation_armor().
| float Character::mutation_armor | ( | bodypart_id | bp, |
| damage_type | dt | ||
| ) | const |
Definition at line 6505 of file character.cpp.
References mutation_armor(), and resistances::type_resist().
| std::vector< special_attack > Character::mutation_attacks | ( | Creature & | t | ) | const |
Returns a vector of valid mutation attacks.
Unarmed increases chance of attacking with mutated body parts Dexterity increases chance of attacking with mutated body partsDefinition at line 1957 of file melee.cpp.
References _, damage_instance::add(), add_msg(), mut_attack::attack_text_npc, mut_attack::attack_text_u, mutation_branch::attacks_granted, mut_attack::base_damage, mut_attack::blocker_mutations, mut_attack::bp, mut_attack::chance, special_attack::damage, Creature::disp_name(), exclusive_flag_coverage(), get_dex(), get_mutations(), get_skill_level(), get_str(), mut_attack::hardcoded_effect, hardcoded_mutation_attack(), Creature::is_player(), m_debug, damage_instance::mult_damage(), name, num_bp, mut_attack::required_mutations, cata::hash64_detail::ret, skill_unarmed, mut_attack::strength_damage, string_format(), body_part_set::test(), special_attack::text, damage_instance::total_damage(), and x_in_y().
Referenced by perform_special_attacks().
| std::map< trait_id, float > Character::mutation_chances | ( | ) | const |
Calculate percentage chances for mutations.
Definition at line 752 of file mutation.cpp.
References mutation_branch::additions, c, calc_category_weights(), genetic_score(), mutation_branch::get_all(), has_trait(), string_id< T >::id(), mutation_category_level, mutation_ok(), normalized_map(), string_id< mutation_branch >::NULL_ID(), mutation_branch::profession, mutation_branch::purifiable, mutation_branch::replacements, score_difference_to_chance(), mutation_branch::threshold, trait_CHAOTIC_BAD, and mutation_branch::valid.
Referenced by debug_menu::debug(), and mutate().
| void Character::mutation_effect | ( | const trait_id & | mut | ) |
Handles things like removal of armor, etc.
Definition at line 258 of file mutation.cpp.
References _, Creature::add_msg_player_or_npc(), apply_mods(), dex_max, get_map(), item::has_flag(), int_max, m_bad, my_mutations, string_id< T >::obj(), on_mutation_gain(), per_max, pos(), recalc_hp(), recalculate_size(), remove_worn_items_with(), str_max, item::tname(), trait_DEX_ALPHA, trait_GLASSJAW, trait_INT_ALPHA, trait_INT_SLIME, trait_PER_ALPHA, and trait_STR_ALPHA.
Referenced by on_item_wear(), set_mutation(), and switch_mutations().
| void Character::mutation_loss_effect | ( | const trait_id & | mut | ) |
Handles what happens when you lose a mutation.
Definition at line 323 of file mutation.cpp.
References apply_mods(), dex_max, int_max, string_id< T >::obj(), on_mutation_loss(), per_max, recalc_hp(), recalculate_size(), str_max, trait_DEX_ALPHA, trait_GLASSJAW, trait_INT_ALPHA, trait_INT_SLIME, trait_PER_ALPHA, and trait_STR_ALPHA.
Referenced by on_item_takeoff(), switch_mutations(), and unset_mutation().
| bool Character::mutation_ok | ( | const trait_id & | mutation, |
| bool | force_good, | ||
| bool | force_bad | ||
| ) | const |
Returns true if the player doesn't have the mutation or a conflicting one and it complies with the force typing.
Definition at line 639 of file mutation.cpp.
References mutation_branch::category, get_bionics(), has_child_flag(), has_trait(), is_category_allowed(), string_id< T >::obj(), mutation_branch::points, and mutation_branch::trait_is_blacklisted().
Referenced by mutate_category(), mutation_chances(), and old_mutate().
| void Character::mutation_spend_resources | ( | const trait_id & | mut | ) |
Removes the appropriate costs (NOTE: will reapply mods & recalc sightlines in case of newly activated mutation).
Definition at line 1723 of file mutation.cpp.
References apply_mods(), Character::trait_data::charge, mutation_branch::cooldown, mutation_branch::cost, mutation_branch::fatigue, mutation_branch::hunger, mod_fatigue(), mod_stored_kcal(), mod_thirst(), my_mutations, string_id< T >::obj(), Character::trait_data::powered, recalc_sight_limits(), and mutation_branch::thirst.
Referenced by activate_mutation(), iexamine::ledge(), and game::vertical_move().
| float Character::mutation_value | ( | const std::string & | val | ) | const |
Goes over all mutations, gets min and max of a value with given name.
Definition at line 6751 of file character.cpp.
References cached_mutations, debugmsg, and mutation_value_map.
Referenced by attack_cost(), calc_needs_rates(), draw_speed_tab(), get_stamina_max(), healing_rate(), healing_rate_medicine(), hearing_ability(), is_immune_effect(), known_magic::mana_regen_rate(), known_magic::max_mana(), mend(), metabolic_rate_base(), overmap_sight_range(), read_speed(), recalc_hp(), player::recalc_speed_bonus(), regen(), reset_stats(), run_cost(), rust_rate(), swim_speed(), update_stamina(), visibility(), game::walk_move(), and weight_capacity().
| bool Character::natural_attack_restricted_on | ( | const bodypart_id & | bp | ) | const |
Returns true if the character is wearing something on the entered body_part, ignoring items with the ALLOWS_NATURAL_ATTACKS flag.
Definition at line 1856 of file character.cpp.
References worn.
Referenced by roll_bash_damage(), roll_cut_damage(), and roll_stab_damage().
| std::vector< item_location > Character::nearby | ( | const std::function< bool(const item *, const item *)> & | func, |
| int | radius = 1 |
||
| ) | const |
Returns nearby items which match the provided predicate.
Definition at line 2252 of file character.cpp.
References NEXT, pos(), and visitable< Character >::visit_items().
Referenced by bandolier_actor::reload(), and npc::within_boundaries_of_camp().
|
overridevirtual |
Calls Creature::normalize() nulls out the player's weapon Should only be called through player::normalize(), not on it's own!
Reimplemented from Creature.
Reimplemented in player.
Definition at line 3470 of file character.cpp.
References martial_arts_data, Creature::normalize(), recalc_hp(), Creature::set_body(), calendar::start_of_cataclysm, and weapon.
Referenced by player::normalize().
| int Character::num_bionics | ( | ) | const |
Returns the size of my_bionics[].
Definition at line 2614 of file bionics.cpp.
References my_bionics.
Referenced by conditional_t< T >::set_has_bionics().
| int Character::nutrition_for | ( | const item & | comest | ) | const |
Handles the nutrition value for a comestible.
Definition at line 460 of file consumption.cpp.
References compute_effective_nutrients(), nutrients::kcal, and islot_comestible::kcal_per_nutr.
Referenced by iuse::blech(), consume_effects(), npc::decide_needs(), player::eat(), iuse::plantblech(), and npc::value().
|
private |
Definition at line 887 of file mutation.cpp.
References mutation_branch::additions, mutation_branch::get_all(), get_highest_category(), has_base_trait(), has_trait(), string_id< T >::id(), is_category_allowed(), mutate_towards(), mutation_ok(), mutations_category, one_in(), mutation_branch::profession, mutation_branch::purifiable, random_entry(), remove_mutation(), mutation_branch::replacements, rng(), mutation_branch::threshold, trait_CHAOTIC_BAD, trait_ROBUST, and mutation_branch::valid.
Referenced by mutate().
|
overrideprotectedvirtual |
Reimplemented from Creature.
Definition at line 4495 of file character.cpp.
References _, Creature::add_msg_if_player(), DT_ELECTRIC, Creature::get_part_hp_cur(), int_id< T >::id(), m_bad, my_bionics, one_in(), rng(), STATIC, type, and x_in_y().
|
overridevirtual |
Called when effect intensity has been changed.
Reimplemented from Creature.
Definition at line 9877 of file character.cpp.
References effect_adrenaline, Creature::get_perceived_pain(), morale, and on_stat_change().
Referenced by load(), and Creature::load().
|
overridevirtual |
This creature just got hit by an attack - possibly special/ranged attack - from source.
Players should train dodge, possibly counter-attack somehow.
Implements Creature.
Reimplemented in player.
Definition at line 8397 of file character.cpp.
References enchantment_cache.
Referenced by melee_attack(), and player::on_hit().
| void Character::on_hurt | ( | Creature * | source, |
| bool | disturb = true |
||
| ) |
Handles effects that happen when the player is damaged and aware of the fact.
Definition at line 8688 of file character.cpp.
References _, Creature::add_effect(), attacked, Creature::disp_name(), effect_adrenaline, effect_narcosis, effect_sleep, g, Creature::get_part_hp_cur(), Creature::has_effect(), has_trait(), Creature::is_dead_state(), Creature::is_npc(), Creature::set_killer(), string_format(), trait_ADRENALINE, and wake_up().
Referenced by apply_damage(), deal_damage(), and hurtall().
| void Character::on_item_takeoff | ( | const item & | it | ) |
Called when an item is taken off.
Definition at line 9864 of file character.cpp.
References calc_encumbrance(), get_stamina(), get_stamina_max(), morale, mutation_loss_effect(), item::mutations_from_wearing(), recalc_sight_limits(), and set_stamina().
Referenced by item::on_takeoff().
| void Character::on_item_wear | ( | const item & | it | ) |
Called when an item is worn.
Definition at line 9849 of file character.cpp.
References calc_encumbrance(), get_stamina(), get_stamina_max(), morale, mutation_effect(), item::mutations_from_wearing(), recalc_sight_limits(), and set_stamina().
Referenced by debug_menu::character_edit_menu(), load(), and item::on_wear().
| void Character::on_mutation_gain | ( | const trait_id & | mid | ) |
Called when a mutation is gained.
Definition at line 9890 of file character.cpp.
References magic, morale, recalculate_enchantment_cache(), and update_type_of_scent().
Referenced by add_bionic(), known_magic::learn_spell(), load(), and mutation_effect().
| void Character::on_mutation_loss | ( | const trait_id & | mid | ) |
Called when a mutation is lost.
Definition at line 9898 of file character.cpp.
References magic, morale, recalculate_enchantment_cache(), and update_type_of_scent().
Referenced by mutation_loss_effect().
|
overridevirtual |
Called when a stat is changed.
Reimplemented from Creature.
Definition at line 9906 of file character.cpp.
References morale.
Referenced by load(), Creature::load(), on_effect_int_change(), set_fatigue(), player::set_pain(), set_painkiller(), and set_thirst().
| void Character::on_worn_item_washed | ( | const item & | it | ) |
Called when an item is washed.
Definition at line 9842 of file character.cpp.
References is_worn(), and morale.
Referenced by wash_activity_actor::finish().
| bool Character::overmap_los | ( | const tripoint_abs_omt & | omt, |
| int | sight_points | ||
| ) |
Returns true if overmap tile is within player line-of-sight.
Definition at line 748 of file character.cpp.
References oter_t::get_see_cost(), global_omt_location(), line(), line_to(), coords::omt, overmap_buffer, coords::coord_point< Point, Origin, Scale >::raw(), overmapbuffer::ter(), coords::coord_point< Point, Origin, Scale >::x(), coords::coord_point< Point, Origin, Scale >::xy(), and coords::coord_point< Point, Origin, Scale >::y().
Referenced by overmap_ui::draw_ascii(), overmap_ui::draw_om_sidebar(), and overmap_ui::draw_overmap_chunk().
| int Character::overmap_sight_range | ( | int | light_level | ) | const |
Returns the distance the player can see on the overmap.
Definition at line 771 of file character.cpp.
References bio_eye_optic, get_per(), has_bionic(), has_item_with_flag(), is_mounted(), MF_MECH_RECON_VISION, mounted_creature, mutation_value(), posz(), SEEX, and sight_range().
Referenced by overmap_ui::draw_ascii(), overmap_ui::draw_om_sidebar(), overmap_ui::draw_overmap_chunk(), and game::update_overmap_seen().
| void Character::passive_absorb_hit | ( | const bodypart_id & | bp, |
| damage_unit & | du | ||
| ) | const |
Check for relevant passive, non-clothing that can absorb damage, and reduce by specified damage unit.
Only flat bonuses are checked here. Multiplicative ones are checked in player::absorb_hit. The damage amount will never be reduced to less than 0. This is called from player::absorb_hit
Definition at line 8044 of file character.cpp.
References damage_unit::amount, bionic_armor_bonus(), DT_CUT, DT_STAB, mabuff_armor_bonus(), mutation_armor(), and damage_unit::type.
Referenced by absorb_hit(), and player::immune_to().
| void Character::passive_power_gen | ( | int | b | ) |
Passively produce power from PERPETUAL fuel.
Definition at line 1311 of file bionics.cpp.
References b, default_daylight_level(), map::emit_field(), flag_PERPETUAL(), units::from_kilojoule(), item::fuel_energy(), bionic_data::fuel_opts, fuel_type_muscle, fuel_type_sun_light, fuel_type_wind, g, get_effective_efficiency(), get_fuel_available(), get_local_windpower(), get_map(), get_weather(), global_omt_location(), item::has_flag(), heat_emission(), bionic::id, bionic::info(), bionic::is_this_fuel_powered(), mod_power_level(), overmap_buffer, bionic_data::passive_fuel_efficiency, pos(), bionic_data::power_gen_emission, overmapbuffer::ter(), and map::veh_at().
Referenced by process_bionic().
| void Character::perform_install | ( | bionic_id | bid, |
| bionic_id | upbid, | ||
| int | difficulty, | ||
| int | success, | ||
| int | pl_skill, | ||
| const std::string & | installer_name, | ||
| const std::vector< trait_id > & | trait_to_rem | ||
| ) |
Success or failure of installation happens here.
Definition at line 2314 of file bionics.cpp.
References _, add_bionic(), add_msg(), bionic_id, bionics_install_failure(), fails_to_install_cbm, g, get_map(), getID(), has_trait(), installs_cbm, map::invalidate_map_cache(), m_good, bionic_data::name, string_id< T >::obj(), remove_bionic(), remove_mutation(), and behavior::success.
Referenced by install_bionics(), and activity_handlers::operation_do_turn().
| void Character::perform_special_attacks | ( | Creature & | t, |
| dealt_damage_instance & | dealt_dam | ||
| ) |
Performs special attacks and their effects (poisonous, stinger, etc.)
Definition at line 1788 of file melee.cpp.
References Creature::as_player(), Creature::deal_melee_attack(), Creature::deal_melee_hit(), hit_roll(), Creature::is_dead_state(), mutation_attacks(), player_hit_message(), player::practice(), rng(), skill_unarmed, and dealt_damage_instance::total_damage().
Referenced by melee_attack().
| void Character::perform_technique | ( | const ma_technique & | technique, |
| Creature & | t, | ||
| damage_instance & | di, | ||
| int & | move_cost | ||
| ) |
Definition at line 1367 of file melee.cpp.
References _, Creature::add_effect(), add_msg(), Creature::add_msg_if_npc(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), damage_unit::amount, ma_technique::aoe, ma_technique::armor_penetration(), b, spell_effect::bash(), bio_cqb, bio_memory, bionic_id, c, ma_technique::damage_bonus(), damage_unit::damage_multiplier, ma_technique::damage_multiplier(), damage_instance::damage_units, ma_technique::disarms, ma_technique::down_dur, DT_BASH, effect_amigara, effect_downed, effect_stunned, time_duration::from_turns(), g, get_damage_unit(), get_int(), get_stamina(), has_active_bionic(), Creature::has_effect(), has_weapon(), is_armed(), is_mounted(), Creature::is_player(), player::is_player(), Creature::knock_back_from(), ma_technique::knockback_dist, ma_technique::knockback_follow, ma_technique::knockback_spread, m_debug, m_good, martial_arts_data, melee_attack(), move_cost(), ma_technique::move_cost_multiplier(), ma_technique::move_cost_penalty(), Creature::moves, name, one_in(), vehicle::player_in_control(), Creature::pos(), pos(), posx(), posy(), posz(), ma_technique::powerful_knockback, print_damage_info(), random_entry(), remove_weapon(), damage_unit::res_pen, rng(), set_stamina(), Creature::setpos(), ma_technique::side_switch, ma_technique::stun_dur, ma_technique::take_weapon, TFLAG_DEEP_WATER, damage_unit::type, valid_aoe_technique(), veh_pointer_or_null(), vehicle::velocity, vgettext(), and wield().
Referenced by melee_attack().
| void Character::perform_uninstall | ( | bionic_id | bid, |
| int | difficulty, | ||
| int | success, | ||
| const units::energy & | power_lvl, | ||
| int | pl_skill | ||
| ) |
Succes or failure of removal happens here.
Definition at line 2048 of file bionics.cpp.
References _, map::add_item(), add_msg(), Creature::add_msg_player_or_npc(), bionics_uninstall_failure(), string_id< T >::c_str(), fails_to_remove_cbm, fault_bionic_nonsterile, item::faults, g, get_map(), getID(), map::invalidate_map_cache(), string_id< T >::is_valid(), bionic_data::itype(), itype_burnt_out_bionic, m_good, m_neutral, mod_max_power_level(), bionic_data::name, string_id< T >::obj(), pos(), remove_bionic(), removes_cbm, and behavior::success.
Referenced by activity_handlers::operation_do_turn(), and uninstall_bionic().
| void Character::pick_name | ( | bool | bUseDefault = false | ) |
Returns a random name from NAMES_*.
Definition at line 129 of file newcharacter.cpp.
References Name::generate(), male, and name.
Referenced by avatar::randomize(), npc::randomize(), and set_description().
| matec_id Character::pick_technique | ( | Creature & | t, |
| const item & | weap, | ||
| bool | crit, | ||
| bool | dodge_counter, | ||
| bool | block_counter | ||
| ) |
Returns a random valid technique.
Definition at line 1115 of file melee.cpp.
References om_direction::all, ma_technique::aoe, ma_technique::block_counter, ma_technique::crit_ok, ma_technique::crit_tec, ma_technique::defensive, ma_technique::disarms, ma_technique::dodge_counter, ma_technique::down_dur, ma_technique::downed_target, ma_technique::dummy, effect_downed, effect_stunned, g, Creature::has_effect(), Creature::has_weapon(), has_weapon(), HUMAN, ma_technique::human_target, ma_technique::id, Creature::in_species(), ma_technique::is_valid_character(), martial_arts_data, one_in(), pos(), random_entry(), ma_technique::stunned_target, ma_technique::take_weapon, tec_none, valid_aoe_technique(), ma_technique::wall_adjacent, and ma_technique::weighting.
Referenced by block_hit(), melee_attack(), and player::on_dodge().
| void Character::place_corpse | ( | ) |
Definition at line 10122 of file character.cpp.
References map::add_item_or_charges(), amount_of_storage_bionics(), Creature::body, death_drops, fault_bionic_nonsterile, item::faults, get_map(), inv_dump(), itype_power_storage, itype_power_storage_mkII, item::make_corpse(), my_bionics, name, string_id< mtype >::NULL_ID(), pos(), and calendar::turn.
Referenced by npc::die(), game::handle_action(), and game::is_game_over().
| void Character::place_corpse | ( | const tripoint_abs_omt & | om_target | ) |
Definition at line 10157 of file character.cpp.
References map::add_item_or_charges(), amount_of_storage_bionics(), Creature::body, map::furn(), inv_dump(), map::load(), item::make_corpse(), my_bionics, name, string_id< mtype >::NULL_ID(), map::points_on_zlevel(), rng(), SEEX, and calendar::turn.
|
overridevirtual |
Implements Creature.
Definition at line 714 of file character.cpp.
References position.
Referenced by absorb_hit(), iuse::acidbomb_act(), activate_bionic(), npc::activate_item(), activate_mutation(), enchantment::activate_passive(), activity_on_turn_move_loot(), map::add_field(), add_known_trap(), inventory_selector::add_nearby_items(), npc::address_player(), adjacent_tile(), npc::alt_attack(), map::apply_character_light(), apply_persistent_morale(), iuse::artifact(), npc::assess_danger(), assign_activity(), activity_handlers::atm_do_turn(), Creature::auto_find_hostile_target(), game::autopilot_vehicles(), npc::avoid_friendly_fire(), player::avoid_trap(), base_comfort_value(), iuse::bell(), best_nearby_lifting_assist(), mattack::bio_op_disarm(), blossoms(), iuse::boltcutters(), burn_fuel(), iuse::burrow(), game::butcher(), activity_handlers::butcher_finish(), butchery_drops_harvest(), butchery_quarter(), set_transformed_iuse::bypass(), iuse::cable_attach(), calc_needs_rates(), calculate_aim_cap(), calculate_dispersion(), iuse::call_of_tindalos(), iuse::camera(), player::can_continue_craft(), can_examine_at(), can_hear(), can_mount(), npc::can_move_to(), character_funcs::can_see_fine_details(), player::can_sleep(), iuse_transform::can_use(), firestarter_actor::can_use(), iuse::capture_monster_act(), iexamine::cardreader_foodplace(), enchantment::cast_enchantment_spell(), iexamine::chainfence(), debug_menu::character_edit_menu(), game::chat(), check_art_charge_req(), player::check_eligible_containers_for_crafting(), check_mount_is_spooked(), check_mount_will_move(), npc::check_or_use_weapon_cbm(), check_outbounds_activity(), iuse::chop_tree(), avatar::clear_memorized_tile(), doors::close_door(), game_menus::inv::compare(), complete_construction(), veh_interact::complete_vehicle(), consider_butchery(), consume_charges(), consume_effects(), player::consume_items(), player::consume_med(), consume_remote_fuel(), player::consume_tools(), game::control_vehicle(), cough(), npc::could_move_onto(), player::craft_consume_tools(), crafting_inventory(), craft_command::create_in_progress_craft(), game::create_starting_npcs(), map::creature_in_field(), game::critter_at(), iuse::crowbar(), iexamine::curtains(), iuse::cut_log_into_planks(), salvage_actor::cut_up(), deactivate_bionic(), deal_damage(), debug_menu::debug(), defer_move(), item_location::impl::item_on_map::describe(), item_location::impl::item_on_vehicle::describe(), vehicle::deserialize(), trap::detect_trap(), npc::die(), iuse::dig(), iuse::dig_channel(), iuse::directional_antenna(), player::disarm(), crafting::disassemble_all(), character_display::disp_info(), game::disp_NPCs(), game::display_scent(), npc::dispose_item(), npc::do_npc_read(), npc::do_pulp(), avatar::do_read(), npc::do_reload(), game::do_turn(), drop_activity_actor::do_turn(), stash_activity_actor::do_turn(), move_items_activity_actor::do_turn(), pickup_activity_actor::do_turn(), throw_activity_actor::do_turn(), iexamine::door_peephole(), game::draw(), draw_bionics_titlebar(), draw_cone_aoe_curses(), draw_env_compact(), draw_health_classic(), anonymous_namespace{animation.cpp}::draw_hit_player_curses(), game::draw_look_around_cursor(), draw_speed_tab(), game::draw_ter(), target_ui::draw_terrain_overlay(), draw_throw_aim(), draw_time_classic(), game::draw_trail_to_square(), draw_veh_compact(), draw_veh_padding(), game::drop(), drop(), drop_invalid_inventory(), npc::drop_items(), talk_function::drop_weapon(), player::eat(), avatar_action::eat_here(), eff_fun_fungus(), eff_fun_hallu(), iuse::einktabletpc(), iexamine::elevator(), emit_radio_signal(), explosion_handler::emp_blast(), npc::enough_time_to_reload(), env_surgery_bonus(), game::examine(), craft_command::execute(), npc::execute_action(), extract_or_wreck_cbms(), npc::faction_display(), iuse::fill_pit(), find_ammo(), find_auto_consume(), find_best_bench(), npc::find_corpse_to_pulp(), npc::find_dangerous_explosives(), npc::find_item(), activity_handlers::find_mount_do_turn(), game::find_nearby_items(), game::find_or_make_stairs(), find_remote_fuel(), character_funcs::fine_detail_vision_mod(), hacking_activity_actor::finish(), npc::finish_read(), fire(), player::fire_gun(), iuse::fishing_rod(), game::fling_creature(), floor_bedding_warmth(), floor_item_warmth(), floor_warmth(), iexamine::flower_marloss(), iexamine::flower_poppy(), activity_handlers::forage_finish(), forced_dismount(), fungal_effects::fungalize(), iuse::fungicide(), mattack::fungus_sprout(), iexamine::fvat_full(), activity_handlers::game_do_turn(), iuse::gasmask(), iexamine::gaspump(), iuse::geiger(), generic_multi_activity_check_requirement(), generic_multi_activity_handler(), generic_multi_activity_locations(), get_avatar(), avatar::get_book_reader(), player::get_crafting_helpers(), game::get_dangerous_tile(), activatable_inventory_preset::get_denial(), get_dodge(), player::get_eligible_containers_for_crafting(), get_heat_radiation(), get_hostile_creatures(), get_item_location(), avatar::get_memorized_tile(), get_next_auto_move_direction(), overmap_ui::get_overmap_path_to(), npc::get_path_avoid(), get_patient(), get_temp(), game::get_veh_dir_indicator_location(), get_visible_creatures(), player::get_weapon_dispersion(), talk_function::give_all_aid(), npc::go_to_omt_destination(), npc::good_escape_direction(), grab(), mattack::grab_drag(), game::grabbed_furn_move(), game::grabbed_veh_move(), npc::guard_current_pos(), iuse::gun_repair(), ranged::gunmode_checks_common(), ranged::gunmode_checks_weapon(), iuse::hacksaw(), activity_handlers::hacksaw_finish(), iuse::hammer(), handbrake(), game::handle_action(), target_ui::handle_cursor_movement(), handle_harvest(), handle_melee_wear(), vehicle::handle_potential_theft(), npc::handle_sound(), vehicle::handle_trap(), player::hardcoded_effects(), has_alarm_clock(), has_fire(), has_neighbor(), has_watch(), haul(), npc::heal_player(), npc::heal_self(), heat_emission(), iuse::honeycomb(), i_add_or_drop(), i_rem(), i_rem_keep_contents(), player::impact(), in_climate_control(), npc_trading::init_buying(), iexamine::intercom(), invoke_item(), npc::is_active(), enchantment::is_active(), place_trap_actor::is_allowed(), is_deaf(), is_driving(), monster::is_fleeing(), game::is_game_over(), game::is_in_viewport(), is_snuggling(), is_solid_neighbor(), ma_requirements::is_valid_character(), is_visible_in_range(), iuse::jackhammer(), player::knock_back_to(), game::knockback(), knows_trap(), firestarter_actor::light_mod(), game::list_items(), game::list_monsters(), monster::load(), vehicle_prototype::load(), game::load(), avatar::load_map_memory(), aim_activity_actor::load_RAS_weapon(), activity_handlers::lockpicking_finish(), activity_handlers::longsalvage_finish(), game::look_around(), npc::look_for_player(), loot(), iuse::lumber(), make_gun_sound_effect(), activity_handlers::make_zlave_finish(), iuse::makemound(), item_action_generator::map_actions_to_items(), marloss_common(), melee_attack(), melee_special_effects(), avatar::memorize_symbol(), npc::method_of_attack(), mill_activate(), target_handler::mode_turrets(), modify_morale(), game::mon_info_update(), game::monmove(), iuse::mop(), npc::move(), avatar_action::move(), npc::move_away_from(), npc::move_to(), npc::move_to_next(), firestarter_actor::moves_cost_by_fuel(), game::moving_vehicle_dismount(), npc::mug_player(), multicooker_hallu(), mutation_effect(), npc::mutiny(), iuse::mycus(), inventory_selector::naturalize_category(), nearby(), iuse::note_bionics(), npc::npc_dismount(), game::npc_menu(), mattack::nurse_assist(), mattack::nurse_check_up(), mattack::nurse_operate(), item_location::impl::item_on_map::obtain_cost(), item_location::impl::item_on_vehicle::obtain_cost(), player::on_dodge(), npc::on_load(), item::on_pickup(), item::on_takeoff(), item::on_wear(), open(), activity_handlers::operation_do_turn(), activity_handlers::operation_finish(), operator_present(), game::overmap_npc_move(), iuse::oxytorch(), activity_handlers::oxytorch_do_turn(), activity_handlers::oxytorch_finish(), passive_power_gen(), iexamine::pay_gas(), game::peek(), perform_technique(), perform_uninstall(), perform_zone_activity_turn(), game::phasing_move(), debug_menu::pick_character(), pick_plant(), pick_technique(), npc::pick_up_item(), iuse::pickaxe(), game::pickup_feet(), iexamine::pit_covered(), place_and_add_as_known(), place_corpse(), npc::place_on_map(), game::place_player(), start_location::place_player(), game::place_player_overmap(), iuse::play_music(), vehicle::player_in_control(), map::player_in_field(), player_on_couch(), pldrive(), item_location::impl::item_on_person::position(), firestarter_actor::prep_firestarter_use(), npc::pretend_fire(), print_aim(), npc::print_info(), print_items(), game::process_artifact(), process_bionic(), player::process_effects_internal(), player::process_items(), sounds::process_sound_markers(), player::process_turn(), prompt_disassemble_in_seq(), prompt_disassemble_single(), activity_handlers::pry_nails_finish(), iexamine::quern_examine(), query_consume_ownership(), plot_options::query_seed(), avatar_action::ramp_move(), mattack::ranged_pull(), player::reach_attack(), npc::reach_omt_destination(), read(), player::recalc_speed_bonus(), recoil_vehicle(), activity_handlers::reload_finish(), vehicle::remote_controlled(), render_wind(), veh_utils::repair_part(), requirements_map(), firestarter_actor::resolve_firestarter_use(), iuse::robotcontrol(), iuse::robotcontrol_can_target(), rod_fish(), rooted(), rooted_message(), route_adjacent(), target_ui::run(), examine_item_menu::run(), run_cost(), avatar::save_map_memory(), npc::say(), player::search_surroundings(), npc::see_item_say_smth(), sees(), sees_with_infrared(), vehicle::serialize(), conditional_t< T >::set_is_driving(), set_item_inventory(), avatar::set_movement_mode(), conditional_t< T >::set_npc_role_nearby(), talk_effect_fun_t::set_u_buy_monster(), monster::setpos(), npc::setpos(), activity_handlers::shear_finish(), npc::shift(), shout(), iexamine::shrub_marloss(), sight_range(), sinkhole_safety_roll(), player::sleep_spot(), smash(), smoker_activate(), iexamine::smoker_options(), player::sort_armor(), spawn_animal(), spawn_spores(), activity_handlers::spellcasting_finish(), spores(), standard_npc::standard_npc(), autodrive_activity_actor::start(), activity_handlers::start_fire_do_turn(), game::start_game(), monster::store(), npc::stow_item(), suffer_from_bad_bionics(), suffer_from_other_mutations(), suffer_from_radiation(), suffer_from_schizophrenia(), suffer_in_sunlight(), suffer_while_underwater(), game::swap_critters(), avatar_action::swim(), symbol_color(), player::takeoff(), iuse::talking_doll(), iuse::tazer(), player::throw_item(), toolweapon_off(), toolweapon_on(), iuse::tow_attach(), iexamine::trap(), activity_handlers::travel_do_turn(), npc::travel_overmap(), iexamine::tree_hickory(), iexamine::tree_maple_tapped(), iexamine::tree_marloss(), explosion_iuse::trigger_explosion(), try_consume(), try_fuel_fire(), game::try_get_left_click_action(), game::try_get_right_click_action(), try_reject_mutagen(), salvage_actor::try_to_cut_up(), player::try_to_sleep(), iuse::unfold_generic(), uninstall_bionic(), player::unload(), update_bodytemp(), update_needs(), npc::update_path(), game::update_stair_monsters(), editmap::update_view_with_help(), iuse_transform::use(), countdown_actor::use(), explosion_iuse::use(), unfold_vehicle_iuse::use(), delayed_transform_iuse::use(), set_transform_iuse::use(), set_transformed_iuse::use(), place_monster_iuse::use(), place_npc_iuse::use(), pick_lock_actor::use(), deploy_furn_actor::use(), firestarter_actor::use(), fireweapon_off_actor::use(), fireweapon_on_actor::use(), manualnoise_actor::use(), musical_instrument_actor::use(), holster_actor::use(), heal_actor::use(), place_trap_actor::use(), emit_actor::use(), mutagen_iv_actor::use(), deploy_tent_actor::use(), unpack_actor::use(), use_charges(), use_fire(), valid_aoe_technique(), game::validate_camps(), game::vertical_move(), activity_handlers::vibe_do_turn(), vomit(), iuse::vortex(), wait(), game::walk_move(), npc::warn_about(), player::wear(), iuse::weather_tool(), npc::wield(), avatar_action::wield(), player::wield_contents(), npc::wont_hit_friend(), npc::worker_downtime(), and game::zones_manager().
Return the position in the worn list where new_item would be put by default.
Definition at line 3929 of file character.cpp.
References worn.
Referenced by item_encumb(), and wear_item().
|
inlineoverridevirtual |
Implements Creature.
Definition at line 779 of file character.h.
References position, and tripoint::x.
Referenced by absorb_hit(), armor_absorb(), iuse::artifact(), iuse::blood_draw(), iuse::boltcutters(), iuse::can_goo(), deal_damage(), debug_menu::debug(), iuse::directional_hologram(), game::draw_ter(), iuse::extinguisher(), game::find_or_make_stairs(), generate_weather_anim_frame(), npc::global_square_location(), game::handle_action(), player::hardcoded_effects(), game::knockback(), iexamine::ledge(), npc::load(), iuse::meth(), iuse::mind_splicer(), avatar_action::move(), npc::move_to(), game::moving_vehicle_dismount(), perform_technique(), game::phasing_move(), npc::pick_up_item(), npc::place_on_map(), player_hit_message(), iuse::portal(), game::process_artifact(), avatar_action::ramp_move(), mattack::riotbot(), avatar_action::swim(), game::try_get_right_click_action(), player::uncanny_dodge(), game::update_map(), npc::update_path(), game::update_stair_monsters(), consume_drug_iuse::use(), enzlave_actor::use(), place_trap_actor::use(), valid_aoe_technique(), npc::vehicle_danger(), game::vertical_move(), and game::walk_move().
|
inlineoverridevirtual |
Implements Creature.
Definition at line 782 of file character.h.
References position, and tripoint::y.
Referenced by absorb_hit(), armor_absorb(), iuse::artifact(), iuse::blood_draw(), iuse::boltcutters(), iuse::can_goo(), deal_damage(), debug_menu::debug(), iuse::directional_hologram(), game::draw_ter(), iuse::extinguisher(), game::find_nearby_items(), game::find_or_make_stairs(), generate_weather_anim_frame(), npc::global_square_location(), game::handle_action(), player::hardcoded_effects(), game::knockback(), iexamine::ledge(), npc::load(), iuse::meth(), iuse::mind_splicer(), avatar_action::move(), npc::move_to(), game::moving_vehicle_dismount(), perform_technique(), game::phasing_move(), npc::pick_up_item(), npc::place_on_map(), player_hit_message(), iuse::portal(), game::process_artifact(), avatar_action::ramp_move(), mattack::riotbot(), avatar_action::swim(), game::try_get_right_click_action(), player::uncanny_dodge(), game::update_map(), npc::update_path(), game::update_stair_monsters(), consume_drug_iuse::use(), enzlave_actor::use(), place_trap_actor::use(), valid_aoe_technique(), npc::vehicle_danger(), game::vertical_move(), and game::walk_move().
|
inlineoverridevirtual |
Implements Creature.
Definition at line 785 of file character.h.
References position, and tripoint::z.
Referenced by npc::address_needs(), iuse::artifact(), game::calc_driving_offset(), iuse::can_goo(), game::chat(), check_art_charge_req(), explosion_handler::do_blast_new(), npc::do_pulp(), overmap_ui::draw_ascii(), game::draw_minimap(), overmap_ui::draw_om_sidebar(), overmap_ui::draw_overmap_chunk(), draw_speed_tab(), npc::execute_action(), overmapbuffer::fix_npcs(), generate_weather_anim_frame(), game::get_player_input(), game::handle_action(), player::hardcoded_effects(), activity_handlers::hotwire_finish(), iexamine::ledge(), npc::load(), game::look_around(), iuse::meth(), npc::move(), avatar_action::move(), npc::move_to(), overmap_sight_range(), perform_technique(), game::phasing_move(), npc::pick_up_item(), npc::place_on_map(), start_location::place_player(), iuse::portal(), game::process_artifact(), sounds::process_sound_markers(), iuse::radiocontrol(), avatar_action::ramp_move(), player::recalc_speed_bonus(), DefaultRemovePartHandler::removed(), conditional_t< T >::set_npc_role_nearby(), npc::set_omt_destination(), smash(), game::try_get_right_click_action(), game::update_overmap_seen(), npc::update_path(), game::update_stair_monsters(), editmap::update_view_with_help(), consume_drug_iuse::use(), npc::vehicle_danger(), game::vertical_move(), and game::walk_move().
Try to pour the given liquid into the given container/vehicle.
The transferred charges are removed from the liquid item. Check the charges of afterwards to see if anything has been transferred at all. The functions do not consume any move points.
false indicates the transfer is not possible at all. true indicates at least some of the liquid has been moved. Definition at line 6444 of file character.cpp.
References _, Creature::add_msg_if_player(), item::charges, item::fill_with(), item::get_remaining_capacity_for_liquid(), inv, m_bad, item::tname(), and inventory::unsort().
Referenced by activity_handlers::fill_liquid_do_turn().
Definition at line 6466 of file character.cpp.
References _, Creature::add_msg_if_player(), item::charges, item::color(), get_all_colors(), get_name(), units::legacy_volume_factor, vehicle::name, round_up(), veh_interact::select_part(), itype::stack_size, string_format(), PATH_INFO::title(), item::tname(), units::to_liter(), item::type, and item::type_name().
|
overridevirtual |
Returns an approximation of the creature's strength.
Implements Creature.
Definition at line 9965 of file character.cpp.
References item::damage_melee(), DT_BASH, DT_CUT, DT_STAB, get_size(), item::is_gun(), is_wearing_power_armor(), MS_HUGE, cata::hash64_detail::ret, item::volume(), and weapon.
| void Character::print_health | ( | ) | const |
Definition at line 4195 of file character.cpp.
References _, Creature::add_msg_if_player(), get_healthy(), has_trait(), Creature::is_player(), m_bad, m_good, snippet_library::random_from_category(), SNIPPET, and trait_SELFAWARE.
Referenced by activate_mutation(), and avatar::wake_up().
|
overridevirtual |
Write information about this creature.
| w | the window to print the text into. |
| vStart | vertical start to print, that means the first line to print. |
| vLines | number of lines to print at most (printing less is fine). |
| column | horizontal start to print (column), horizontal end is one character before the right border of the window (to keep the border). |
Implements Creature.
Reimplemented in npc.
Definition at line 10331 of file character.cpp.
References _, catacurses::mvwprintw(), and name.
| void Character::process_bionic | ( | int | b | ) |
Handles bionic effects over time of the entered bionic.
Definition at line 1526 of file bionics.cpp.
References _, sounds::activity, add_morale(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), afs_bio_dopamine_stimulators, attempt_recharge(), b, bio_ads, bio_evap, bio_gills, bio_hydraulics, bio_nanobots, bio_painkiller, bio_remote, burn_fuel(), bionic_data::charge_time, bionic::charge_timer, deactivate_bionic(), effect_asthma, effect_bleed, bionic::energy_stored, find_remote_fuel(), flag_PERPETUAL(), bionic_data::fuel_opts, g, Creature::get_all_body_parts(), bionic::get_auto_start_thresh(), Creature::get_body(), Creature::get_effect(), get_fuel_available(), effect::get_intensity(), get_local_humidity(), get_max_power_level(), Creature::get_pain(), get_painkiller(), get_power_level(), weather_manager::get_precise(), get_stim(), get_stored_kcal(), get_thirst(), Creature::get_value(), get_weather(), Creature::has_effect(), bionic_data::has_flag(), Creature::has_flag(), heal(), w_point::humidity, hydrated, bionic::id, string_id< T >::id(), bionic::info(), bionic::is_auto_start_on(), string_id< T >::is_empty(), bionic_data::is_remote_fueled, m_bad, m_good, m_mixed, m_neutral, m_warning, max_stored_kcal(), effect::mod_intensity(), Creature::mod_pain(), mod_painkiller(), mod_power_level(), mod_stim(), mod_stored_kcal(), mod_thirst(), MORALE_FEELING_GOOD, bionic_data::name, calendar::once_every(), Creature::pain, passive_power_gen(), pkill, pos(), bionic_data::power_over_time, bionic::powered, Creature::remove_effect(), rng(), sounds::sound(), STATIC, and string_id< T >::str().
Referenced by suffer().
|
overridevirtual |
Handles end-of-turn processing.
Reimplemented from Creature.
Reimplemented in npc, and player.
Definition at line 1642 of file character.cpp.
References _, Creature::add_msg_if_player(), m_bad, my_bionics, and Creature::process_turn().
Referenced by player::process_turn().
|
inline |
It is supposed to hide the query_yn to simplify player vs.
npc code.
Definition at line 1435 of file character.h.
References query_yn(), and string_format().
Referenced by activate_bionic(), can_install_bionics(), feed_reactor_with(), query_yn(), and will_eat().
|
pure virtual |
|
virtual |
Definition at line 4129 of file character.cpp.
References get_dex().
Referenced by draw_stats_info(), player::get_weapon_dispersion(), and set_stats().
|
virtual |
Definition at line 4135 of file character.cpp.
References get_per().
Referenced by draw_stats_info(), effective_dispersion(), and set_stats().
| void Character::react_to_felt_pain | ( | int | intensity | ) |
Definition at line 853 of file character.cpp.
References _, effect_narcosis, effect_sleep, g, Creature::has_effect(), has_trait(), Creature::is_player(), pain, rng(), trait_HEAVYSLEEPER, trait_HEAVYSLEEPER2, and wake_up().
Referenced by player::set_pain(), and set_painkiller().
| int Character::read_speed | ( | bool | return_stat_effect = true | ) | const |
Returns the player's reading speed.
Intelligence increases reading speed by 3s per level above 8Definition at line 3422 of file character.cpp.
References afs_bio_linguistic_coprocessor, get_int(), has_bionic(), mutation_value(), and cata::hash64_detail::ret.
Referenced by draw_stats_info(), read_inventory_preset::read_inventory_preset(), set_stats(), npc::time_to_read(), and avatar::time_to_read().
| void Character::rebuild_mutation_cache | ( | ) |
Definition at line 8027 of file character.cpp.
References cached_mutations, enchantment_cache, and my_mutations.
Referenced by set_mutation(), and unset_mutation().
| void Character::recalc_hp | ( | ) |
Recalculates HP after a change to max strength.
Definition at line 1656 of file character.cpp.
References calc_all_parts_hp(), skill_boost::get(), get_skill_level(), mutation_value(), skill_id, and str_max.
Referenced by apply_mods(), apply_skill_boost(), avatar::create(), mutation_effect(), mutation_loss_effect(), normalize(), player::normalize(), npc::randomize(), reset_scenario(), set_stats(), and standard_npc::standard_npc().
| void Character::recalc_sight_limits | ( | ) |
Modifies the player's sight values Must be called when any of the following change: This must be called when any of the following change:
Definition at line 1703 of file character.cpp.
References AEP_CLAIRVOYANCE, AEP_CLAIRVOYANCE_PLUS, AEP_SUPER_CLAIRVOYANCE, bio_infrared, bio_membrane, BIRD_EYE, BOOMERED, bp_eyes, cached_mutations, DARKNESS, DEBUG_NIGHTVISION, effect_boomered, effect_contacts, effect_darkness, effect_in_pit, effect_narcosis, effect_no_sight, encumb(), flag_FIX_NEARSIGHT(), flag_IR_EFFECT(), flag_SWIM_GOGGLES(), get_per(), has_active_bionic(), has_active_mutation(), has_artifact_with(), has_bionic(), Creature::has_effect(), Creature::has_effect_with_flag(), has_nv(), has_trait(), in_sleep_state(), IR_VISION, is_blind(), is_mounted(), is_wearing(), itype_rm13_armor_on, MF_MECH_RECON_VISION, mounted_creature, NV_GOGGLES, nv_range, vision::nv_range_from_eye_encumbrance(), vision::nv_range_from_per(), sight_max, trait_BIRD_EYE, trait_CEPH_EYES, trait_DEBUG_NIGHTVISION, trait_INFRARED, trait_LIZ_IR, trait_MEMBRANE, trait_MYOPIC, trait_PER_SLIME, trait_PER_SLIME_OK, trait_SEESLEEP, trait_SHELL2, trait_URSINE_EYE, Creature::underwater, URSINE_VISION, VISION_CLAIRVOYANCE, VISION_CLAIRVOYANCE_PLUS, VISION_CLAIRVOYANCE_SUPER, vision_mode_cache, and worn_with_flag().
Referenced by add_bionic(), deactivate_mutation(), player::environmental_revert_effect(), load(), game::load(), mount_creature(), mutation_spend_resources(), on_item_takeoff(), on_item_wear(), player::player(), remove_bionic(), player::reset_stats(), set_mutation(), player::set_underwater(), player::takeoff(), unset_mutation(), wake_up(), and wear_item().
| void Character::recalculate_enchantment_cache | ( | ) |
Definition at line 7986 of file character.cpp.
References enchantment_cache, item::get_enchantments(), NEXT, and visitable< Character >::visit_items().
Referenced by activate_bionic(), activate_mutation(), add_bionic(), deactivate_bionic(), deactivate_mutation(), on_mutation_gain(), on_mutation_loss(), remove_bionic(), reset(), update_body(), and player::use().
| void Character::recalculate_size | ( | ) |
Recalculate size class of character.
Definition at line 246 of file mutation.cpp.
References cached_mutations, MS_MEDIUM, and size_class.
Referenced by load(), mutation_effect(), and mutation_loss_effect().
| double Character::recoil_mode | ( | ) | const |
| double Character::recoil_total | ( | ) | const |
Current total maximum recoil penalty from all sources.
Definition at line 2062 of file ranged.cpp.
References recoil, and recoil_vehicle().
Referenced by player::fire_gun(), npc::method_of_attack(), npc::move(), target_ui::panel_recoil(), and npc::wont_hit_friend().
| double Character::recoil_vehicle | ( | ) | const |
Get maximum recoil penalty due to vehicle motion.
Definition at line 2050 of file ranged.cpp.
References g, in_vehicle, and pos().
Referenced by player::fire_gun(), print_aim(), and recoil_total().
| int Character::reduce_healing_effect | ( | const efftype_id & | eff_id, |
| int | remove_med, | ||
| const bodypart_id & | hurt | ||
| ) |
Reduce healing effect intensity, return initial intensity of the effect.
Definition at line 8615 of file character.cpp.
References _, Creature::add_msg_if_player(), body_part_name(), effect_bandaged, effect_disinfected, Creature::get_effect(), effect::get_intensity(), m_bad, and effect::mod_duration().
Referenced by apply_damage().
| void Character::regen | ( | int | rate_multiplier | ) |
Handles passive regeneration of pain and maybe hp.
Definition at line 4548 of file character.cpp.
References _, Creature::add_msg_if_player(), body_part_name(), convert_bp(), damage_bandaged, damage_disinfected, effect_bandaged, effect_disinfected, Creature::get_pain(), Creature::get_part(), get_rad(), Creature::has_effect(), heal(), healall(), healed_bp(), healing_rate(), healing_rate_medicine(), hp_to_bp(), hurtall(), string_id< T >::id(), Creature::mod_pain(), mod_rad(), mutation_value(), num_hp_parts, Creature::remove_effect(), rest_quality(), and roll_remainder().
Referenced by update_body().
| void Character::rem_addiction | ( | add_type | type | ) |
Removes an addition from the player.
Definition at line 1945 of file suffer.cpp.
References addictions, g, getID(), loses_addiction, and type.
Referenced by marloss_common(), iuse::mycus(), and suffer_from_addictions().
| void Character::rem_morale | ( | const morale_type & | type | ) |
Definition at line 9112 of file character.cpp.
Referenced by apply_persistent_morale(), monster::die(), player::fire_gun(), modify_addiction(), firestarter_actor::resolve_firestarter_use(), iuse::towel_common(), update_bodytemp(), and avatar::vomit().
| void Character::remove_bionic | ( | const bionic_id & | b | ) |
Removes a bionic from my_bionics[].
Definition at line 2577 of file bionics.cpp.
References b, magic, my_bionics, recalc_sight_limits(), recalculate_enchantment_cache(), and reset_encumbrance().
Referenced by perform_install(), perform_uninstall(), and uninstall_bionic().
| void Character::remove_child_flag | ( | const trait_id & | flag | ) |
Removes the mutation's child flag from the player's list.
Definition at line 1496 of file mutation.cpp.
References has_child_flag(), has_trait(), remove_child_flag(), remove_mutation(), and mutation_branch::replacements.
Referenced by mutate_towards(), and remove_child_flag().
| void Character::remove_mission_items | ( | int | mission_id | ) |
Definition at line 2576 of file character.cpp.
References visitable< Character >::remove_items_with().
| void Character::remove_mutation | ( | const trait_id & | mut, |
| bool | silent = false |
||
| ) |
Removes a mutation, downgrading to the previous level if possible.
Definition at line 1338 of file mutation.cpp.
References _, Creature::add_msg_player_or_npc(), drench_mut_calc(), mutation_branch::get_all(), has_base_trait(), has_trait(), m_bad, m_good, m_mixed, m_neutral, string_id< mutation_branch >::NULL_ID(), string_id< T >::obj(), set_highest_cat_level(), set_mutation(), silent, and unset_mutation().
Referenced by do_purify(), player::load(), mutate(), mutate_towards(), old_mutate(), perform_install(), iuse::purify_iv(), iuse::purify_smart(), remove_child_flag(), and debug_menu::wishmutate().
| item Character::remove_weapon | ( | ) |
Definition at line 2568 of file character.cpp.
References cached_info, and weapon.
Referenced by talk_function::drop_weapon(), melee_special_effects(), perform_technique(), mattack::pull_metal_weapon(), smash(), npc::stow_item(), and use_amount().
Similar to remove_items_with, but considers only worn items and not their content (item::contents is not checked).
If the filter function returns true, the item is removed.
Definition at line 2347 of file character.cpp.
References worn.
Referenced by mutation_effect(), and player::process_items().
|
overridevirtual |
Handles stat and bonus reset.
Reimplemented from Creature.
Definition at line 3622 of file character.cpp.
References recalculate_enchantment_cache(), and Creature::reset().
Referenced by activate_bionic(), deactivate_bionic(), game::load(), and set_stats().
|
overridevirtual |
Resets the value of all bonus fields to 0.
Reimplemented from Creature.
Definition at line 4525 of file character.cpp.
References dex_bonus, int_bonus, per_bonus, Creature::reset_bonuses(), and str_bonus.
| void Character::reset_chargen_attributes | ( | ) |
Definition at line 6880 of file character.cpp.
References init_age, and init_height.
| void Character::reset_encumbrance | ( | ) |
Recalculates encumbrance cache.
Definition at line 3643 of file character.cpp.
References calc_encumbrance(), and encumbrance_cache.
Referenced by activate_bionic(), add_bionic(), change_side(), check_item_encumbrance_flag(), salvage_actor::cut_up(), deactivate_bionic(), player::environmental_revert_effect(), load(), player::player(), player::process_items(), remove_bionic(), iuse::rm13armor_off(), iuse::rm13armor_on(), set_mutation(), player::sort_armor(), player::start_craft(), player::store(), player::takeoff(), unset_mutation(), iuse_transform::use(), and wear_item().
| void Character::reset_remote_fuel | ( | ) |
Definition at line 1445 of file bionics.cpp.
References fuel_type_sun_light, get_bionic_fueled_with(), and Creature::remove_value().
Referenced by iuse::cable_attach(), and deactivate_bionic().
|
overridevirtual |
Resets stats, and applies effects in an idempotent manner.
Implements Creature.
Reimplemented in player.
Definition at line 3577 of file character.cpp.
References apply_skill_boost(), bio_hydraulics, dex_cur, dex_max, DEXTERITY, get_dex_bonus(), get_int_bonus(), get_mod_stat_from_bionic(), get_per_bonus(), get_str_bonus(), has_active_bionic(), int_cur, int_max, INTELLIGENCE, mod_dex_bonus(), Creature::mod_dodge_bonus(), mod_int_bonus(), mod_per_bonus(), mod_str_bonus(), mutation_value(), nv_cached, per_cur, per_max, PERCEPTION, str_cur, str_max, and STRENGTH.
Referenced by player::reset_stats().
| float Character::rest_quality | ( | ) | const |
Returns >0 if character is sitting/lying and relatively inactive.
1 represents sleep on comfortable bed, so anything above that should be rare.
Definition at line 6556 of file character.cpp.
References effect_sleep, and Creature::has_effect().
| void Character::restore_scent | ( | ) |
restore scent after masked_scent effect run out or is removed by water
Definition at line 8764 of file character.cpp.
References _, Creature::add_msg_if_player(), effect_masked_scent, Creature::get_value(), m_info, Creature::remove_effect(), Creature::remove_value(), and set_type_of_scent().
Referenced by drench(), and player::process_turn().
| void Character::resume_backlog_activity | ( | ) |
Definition at line 9264 of file character.cpp.
References activity, and backlog.
Referenced by game::cancel_activity_query(), and player_activity::do_turn().
| void Character::roll_all_damage | ( | bool | crit, |
| damage_instance & | di, | ||
| bool | average, | ||
| const item & | weap | ||
| ) | const |
Adds all 3 types of physical damage to instance.
Definition at line 351 of file melee.cpp.
References roll_bash_damage(), roll_cut_damage(), and roll_stab_damage().
Referenced by item::effective_dps(), and melee_attack().
| void Character::roll_bash_damage | ( | bool | crit, |
| damage_instance & | di, | ||
| bool | average, | ||
| const item & | weap | ||
| ) | const |
Adds player's total bash damage to the damage instance.
Strength increases bashing damage Strength increases bashing damage Unarmed caps bash damage with unarmed weapons Bashing caps bash damage with bashing weapons Strength boosts low cap on bashing damageDefinition at line 870 of file melee.cpp.
References damage_instance::add_damage(), bio_cqb, BIO_CQB_LEVEL, bonus_damage(), item::damage_melee(), DT_BASH, effect_drunk, Creature::get_effect_dur(), get_mutations(), get_skill_level(), get_str(), has_active_bionic(), has_active_mutation(), Creature::has_effect(), has_trait(), item::is_null(), item::is_unarmed_weapon(), mabuff_arpen_bonus(), mabuff_damage_bonus(), mabuff_damage_mult(), natural_attack_restricted_on(), rng(), rng_float(), skill_bashing, skill_unarmed, and trait_DRUNKEN.
Referenced by roll_all_damage().
| void Character::roll_cut_damage | ( | bool | crit, |
| damage_instance & | di, | ||
| bool | average, | ||
| const item & | weap | ||
| ) | const |
Adds player's total cut damage to the damage instance.
Cutting increases cutting damage multiplierDefinition at line 974 of file melee.cpp.
References damage_instance::add_damage(), bio_cqb, BIO_CQB_LEVEL, bionic_id, item::damage_melee(), DT_CUT, get_mutations(), get_skill_level(), has_active_bionic(), has_active_mutation(), has_bionic(), item::is_null(), item::is_unarmed_weapon(), mabuff_arpen_bonus(), mabuff_damage_bonus(), mabuff_damage_mult(), natural_attack_restricted_on(), rng(), skill_cutting, and skill_unarmed.
Referenced by roll_all_damage().
| void Character::roll_stab_damage | ( | bool | crit, |
| damage_instance & | di, | ||
| bool | average, | ||
| const item & | weap | ||
| ) | const |
Adds player's total stab damage to the damage instance.
Stabbing increases stabbing damage multiplierDefinition at line 1048 of file melee.cpp.
References damage_instance::add_damage(), bio_cqb, BIO_CQB_LEVEL, bionic_id, item::damage_melee(), DT_STAB, get_mutations(), get_skill_level(), has_active_bionic(), has_bionic(), item::is_null(), item::is_unarmed_weapon(), mabuff_arpen_bonus(), mabuff_damage_bonus(), mabuff_damage_mult(), natural_attack_restricted_on(), skill_stabbing, and skill_unarmed.
Referenced by roll_all_damage().
| void Character::rooted | ( | ) |
Definition at line 8842 of file character.cpp.
References flag_PLOWABLE(), footwear_factor(), get_map(), get_thirst(), Creature::has_flag(), has_trait(), mod_healthy_mod(), mod_thirst(), one_in(), pos(), trait_ROOTS2, trait_ROOTS3, turgid, vitamin_mod(), and x_in_y().
Referenced by player_activity::do_turn().
| void Character::rooted_message | ( | ) | const |
Handles rooting effects.
Definition at line 8832 of file character.cpp.
References _, add_msg(), flag_PLOWABLE(), get_map(), Creature::has_flag(), has_trait(), is_wearing_shoes(), LEFT, m_info, pos(), RIGHT, trait_ROOTS2, and trait_ROOTS3.
Referenced by player_activity::start_or_resume().
| int Character::run_cost | ( | int | base_cost, |
| bool | diag = false |
||
| ) | const |
Returns the player's modified base movement cost.
Definition at line 10015 of file character.cpp.
References bio_jointservo, bonus_from_enchantments(), bp_foot_l, bp_foot_r, bp_leg_l, bp_leg_r, CMM_RUN, encumb(), footwear_factor(), get_map(), Creature::get_part_hp_cur(), Creature::get_part_hp_max(), has_active_bionic(), has_bionic(), map::has_flag(), map::has_flag_ter_or_furn(), has_trait(), is_mounted(), M_SQRT2, enchant_vals::MOVE_COST, move_mode, mutation_value(), pos(), stamina_move_cost_modifier(), trait_M_IMMUNE, trait_PADDED_FEET, trait_ROOTS3, and worn_with_flag().
Referenced by draw_speed_tab(), npc::move_to(), speed_description(), speed_rating(), npc::speed_rating(), and game::walk_move().
| int Character::rust_rate | ( | ) | const |
Returns the player's skill rust rate.
Intelligence reduces skill rust by 10% per level above 8Definition at line 3400 of file character.cpp.
References get_int(), mutation_value(), and cata::hash64_detail::ret.
Referenced by do_skill_rust(), draw_stats_info(), and set_stats().
| bool Character::scored_crit | ( | float | target_dodge, |
| const item & | weap | ||
| ) | const |
Returns true if the player scores a critical hit.
Definition at line 729 of file melee.cpp.
References crit_chance(), hit_roll(), and rng_float().
Referenced by melee_attack().
|
overridevirtual |
The functions check whether this creature can see the target.
The target may either be another creature (critter), or a specific point on the map.
The function that take another creature as input should check visibility of that creature (e.g. not digging, or otherwise invisible). They must than check whether the location of the other monster is visible.
Reimplemented from Creature.
Definition at line 10428 of file character.cpp.
References has_active_mutation(), Creature::pos(), pos(), rl_dist(), Creature::sees(), and trait_ANTENNAE.
|
overridevirtual |
Reimplemented from Creature.
Definition at line 10411 of file character.cpp.
References clairvoyance(), get_map(), Creature::is_player(), MAX_CLAIRVOYANCE, map::pl_sees(), pos(), rl_dist(), Creature::sees(), and unimpaired_range().
Referenced by npc::address_needs(), npc::address_player(), grid_furn_transform_queue::apply(), npc::assess_danger(), bionics_uninstall_failure(), calculate_aim_cap(), game::catch_a_monster(), game::chat(), check_mount_is_spooked(), check_mount_will_move(), npc::check_or_use_weapon_cbm(), npc::complain(), npc::do_reload(), draw_critter_internal(), game::draw_line(), game::draw_look_around_cursor(), draw_throw_aim(), npc::drop_items(), explosion_handler::emp_blast(), npc::enough_time_to_reload(), npc::execute_action(), game::extended_description(), npc::find_corpse_to_pulp(), npc::find_item(), game::find_nearby_items(), heal_actor::finish_using(), game::fling_creature(), npc::follow_distance(), game::forced_door_closing(), fungal_effects::fungalize(), generic_multi_activity_check_requirement(), get_hostile_creatures(), get_path_avoid(), game::get_player_input(), get_visible_creatures(), game::handle_action(), npc::handle_sound(), vehicle::handle_trap(), npc::heal_player(), npc::heal_self(), talk_function::hostile(), is_visible_in_range(), mdeath::jabberwock(), game::knockback(), target_ui::list_friendlies_in_lof(), game::list_items(), game::look_around(), npc::method_of_attack(), npc::move(), npc::mug_player(), iuse::note_bionics(), target_ui::panel_target_info(), npc::pick_up_item(), pl_sees(), npc::pretend_heal(), game::print_creature_info(), npc::print_info(), sounds::process_sound_markers(), npc::reach_omt_destination(), npc::regen_ai_cache(), iuse::robotcontrol(), player::search_surroundings(), npc::see_item_say_smth(), activity_handlers::spellcasting_finish(), fungal_effects::spread_fungus_one_tile(), suffer_from_schizophrenia(), game::try_get_right_click_action(), game::update_stair_monsters(), editmap::update_view_with_help(), countdown_actor::use(), and npc::use_painkiller().
| bool Character::sees_with_infrared | ( | const Creature & | critter | ) | const |
Check whether the this player can see the other creature with infrared.
This implies this player can see infrared and the target is visible with infrared (is warm). And of course a line of sight exists.
Definition at line 10200 of file character.cpp.
References current_daylight_level(), get_map(), IR_VISION, Creature::is_player(), Creature::is_warm(), map::pl_line_of_sight(), Creature::pos(), pos(), map::sees(), sight_range(), calendar::turn, and vision_mode_cache.
Referenced by calculate_aim_cap(), draw_critter_internal(), target_ui::panel_target_info(), pl_sees(), and game::print_all_tile_info().
| bool Character::sees_with_specials | ( | const Creature & | critter | ) | const |
Definition at line 6425 of file character.cpp.
References bio_ground_sonar, Creature::digging(), has_active_bionic(), Creature::has_flag(), has_trait(), Creature::in_species(), MF_ELECTRIC, ROBOT, and trait_ELECTRORECEPTORS.
Referenced by draw_critter_internal(), target_ui::panel_target_info(), pl_sees(), and game::print_all_tile_info().
| void Character::set_base_age | ( | int | age | ) |
Definition at line 6891 of file character.cpp.
References age(), and init_age.
Referenced by debug_menu::character_edit_menu(), and set_description().
| void Character::set_base_height | ( | int | height | ) |
Definition at line 6920 of file character.cpp.
References height(), and init_height.
Referenced by debug_menu::character_edit_menu(), and set_description().
|
inline |
Definition at line 1933 of file character.h.
References check_encumbrance.
| void Character::set_destination | ( | const std::vector< tripoint > & | route, |
| const player_activity & | new_destination_activity = player_activity() |
||
| ) |
Definition at line 10462 of file character.cpp.
References auto_move_route, destination_point, get_map(), and set_destination_activity().
Referenced by activity_on_turn_move_loot(), game::cancel_activity_or_ignore_query(), game::cancel_activity_query(), activity_handlers::find_mount_do_turn(), generic_multi_activity_handler(), game::handle_action(), game::list_items(), game::look_around(), perform_zone_activity_turn(), activity_handlers::travel_do_turn(), and game::try_get_left_click_action().
| void Character::set_destination_activity | ( | const player_activity & | new_destination_activity | ) |
Definition at line 1018 of file character.cpp.
References destination_activity.
Referenced by set_destination().
|
virtual |
| void Character::set_fac_id | ( | const std::string & | my_fac_id | ) |
Definition at line 7879 of file character.cpp.
References fac_id.
Referenced by npc_template::load().
|
virtual |
Definition at line 4440 of file character.cpp.
References fatigue, and on_stat_change().
Referenced by npc::address_needs(), debug_menu::character_edit_menu(), check_needs_extremes(), player::environmental_revert_effect(), basecamp::finish_return(), player::hardcoded_effects(), mod_fatigue(), and update_needs().
|
virtual |
Setters for health values exclusive to characters.
Definition at line 4242 of file character.cpp.
References healthy.
Referenced by debug_menu::character_edit_menu(), and player::environmental_revert_effect().
|
virtual |
Definition at line 4254 of file character.cpp.
References healthy_mod.
Referenced by debug_menu::character_edit_menu(), player::environmental_revert_effect(), suffer_from_radiation(), update_health(), and vomit().
| void Character::set_highest_cat_level | ( | ) |
Recalculates mutation_category_level[] values for the player.
Definition at line 7923 of file character.cpp.
References build_mut_dependency_map(), mutation_branch::category, mutation_branch::flags, get_mutations(), and mutation_category_level.
Referenced by avatar::load(), mutate_towards(), remove_mutation(), and game::start_game().
|
virtual |
| void Character::set_max_power_level | ( | const units::energy & | npower_max | ) |
Definition at line 1982 of file character.cpp.
References max_power_level.
Referenced by bionics_install_failure(), and player::player().
|
pure virtual |
Implemented in avatar, and npc.
Referenced by dismount(), and forced_dismount().
| void Character::set_mutation | ( | const trait_id & | trait | ) |
Add or removes a mutation on the player, but does not trigger mutation loss/gain effects.
Definition at line 154 of file mutation.cpp.
References mutation_effect(), my_mutations, rebuild_mutation_cache(), recalc_sight_limits(), and reset_encumbrance().
Referenced by add_bionic(), jmapgen_npc::apply(), talk_function::field_build_1(), talk_function::field_build_2(), talk_function::forage_return(), wish_mutate_callback::key(), talk_function::labor_return(), known_magic::learn_spell(), marloss_common(), mutate_towards(), iuse::mycus(), remove_mutation(), talk_function::scavenging_patrol_return(), talk_effect_fun_t::set_add_trait(), switch_mutations(), test_crossing_threshold(), toggle_trait(), try_reject_mutagen(), and debug_menu::wishmutate().
| void Character::set_painkiller | ( | int | npkill | ) |
Sets intensity of painkillers
Definition at line 9788 of file character.cpp.
References Creature::get_perceived_pain(), on_stat_change(), pkill, and react_to_felt_pain().
Referenced by activate_bionic(), player::environmental_revert_effect(), mod_painkiller(), iuse::smoking(), and iuse::weed_cake().
|
virtual |
| void Character::set_power_level | ( | const units::energy & | npower | ) |
Definition at line 1977 of file character.cpp.
References max_power_level, and power_level.
Referenced by activate_bionic(), avatar::create(), mod_power_level(), and player::player().
| void Character::set_rad | ( | int | new_rad | ) |
Definition at line 7181 of file character.cpp.
References radiation.
Referenced by activate_bionic(), debug_menu::character_edit_menu(), player::environmental_revert_effect(), marloss_common(), mod_rad(), iuse::mycus(), player::process_one_effect(), and suffer_from_radiation().
| void Character::set_skill_level | ( | const skill_id & | ident, |
| int | level | ||
| ) |
Definition at line 3366 of file character.cpp.
References get_skill_level_object(), and SkillLevel::level().
Referenced by mattack::frag(), vehicle::get_targeting_npc(), tutorial_game::init(), avatar::randomize(), npc::randomize(), mattack::rifle(), gun_actor::shoot(), standard_npc::standard_npc(), mattack::tankgun(), and debug_menu::wishskill().
|
virtual |
Definition at line 4449 of file character.cpp.
References massive, and sleep_deprivation.
Referenced by debug_menu::character_edit_menu(), player::environmental_revert_effect(), basecamp::finish_return(), mod_sleep_deprivation(), and update_needs().
| void Character::set_stamina | ( | int | new_stamina | ) |
Definition at line 7208 of file character.cpp.
References stamina.
Referenced by iuse::artifact(), debug_menu::character_edit_menu(), player::normalize(), on_item_takeoff(), on_item_wear(), perform_technique(), npc::process_turn(), activity_handlers::read_do_turn(), game::start_game(), iuse::stimpack(), and update_stamina().
| void Character::set_stashed_activity | ( | const player_activity & | act, |
| const player_activity & | act_back = player_activity() |
||
| ) |
Definition at line 978 of file character.cpp.
References act, stashed_outbounds_activity, and stashed_outbounds_backlog.
| void Character::set_stim | ( | int | new_stim | ) |
Definition at line 7166 of file character.cpp.
References stim.
Referenced by activate_bionic(), player::environmental_revert_effect(), modify_stimulation(), and update_needs().
|
virtual |
Setters for need values exclusive to characters.
Definition at line 4310 of file character.cpp.
References max_stored_kcal(), and stored_calories.
Referenced by debug_menu::character_edit_menu(), npc::consume_food(), avatar::create(), player::environmental_revert_effect(), marloss_common(), mod_stored_kcal(), and update_stomach().
|
virtual |
|
virtual |
Definition at line 4422 of file character.cpp.
References on_stat_change(), and thirst.
Referenced by debug_menu::character_edit_menu(), npc::consume_food(), npc::consume_food_from_camp(), player::environmental_revert_effect(), basecamp::finish_return(), mod_thirst(), update_stomach(), and vomit().
|
inline |
set the turn the turn the character died if not already done
Definition at line 1412 of file character.h.
References calendar::before_time_starts, and time_died.
Referenced by die().
| void Character::set_type_of_scent | ( | const scenttype_id & | id | ) |
Definition at line 8754 of file character.cpp.
References id, and type_of_scent.
Referenced by restore_scent(), update_type_of_scent(), and change_scent_iuse::use().
| void Character::setID | ( | character_id | i, |
| bool | force = false |
||
| ) |
Definition at line 466 of file character.cpp.
References debugmsg, character_id::get_value(), Creature::get_value(), and character_id::is_valid().
Referenced by player::load(), game::load(), npc::randomize(), and game::start_game().
|
inlineoverridevirtual |
Implements Creature.
Reimplemented in npc.
Definition at line 797 of file character.h.
References position.
Referenced by iexamine::bars(), map::board_vehicle(), iexamine::chainfence(), debug_menu::character_edit_menu(), dismount(), throw_activity_actor::do_turn(), game::fling_creature(), forced_dismount(), mattack::grab_drag(), game::grabbed_veh_move(), player::knock_back_to(), game::knockback(), trapfunc::ledge(), iexamine::ledge(), monster::move(), monster::nursebot_operate(), game::peek(), game::phasing_move(), game::place_player(), start_location::place_player(), setx(), sety(), setz(), sinkhole_safety_roll(), game::start_game(), avatar_action::swim(), trapfunc::tripwire(), game::update_map(), game::validate_mounted_npcs(), and game::vertical_move().
|
inline |
Definition at line 788 of file character.h.
References position, setpos(), tripoint::y, and tripoint::z.
Referenced by tutorial_game::init(), defense_game::init_map(), start_location::place_player(), set_stats(), and game::update_stair_monsters().
|
inline |
Definition at line 791 of file character.h.
References position, setpos(), tripoint::x, and tripoint::z.
Referenced by tutorial_game::init(), defense_game::init_map(), start_location::place_player(), and game::update_stair_monsters().
|
inline |
Definition at line 794 of file character.h.
References position, setpos(), and tripoint::xy().
Referenced by start_location::place_player(), and game::vertical_shift().
| void Character::shift_destination | ( | const point & | shift | ) |
Definition at line 10337 of file character.cpp.
References auto_move_route, and next_expected_position.
Referenced by game::update_map().
| int Character::shoe_type_count | ( | const itype_id & | it | ) | const |
Returns 1 if the player is wearing an item of that count on one foot, 2 if on both, and zero if on neither.
Definition at line 8947 of file character.cpp.
References is_wearing_on_bp(), and cata::hash64_detail::ret.
Referenced by avatar_action::swim(), and game::vertical_move().
| std::string Character::short_description | ( | ) | const |
Definition at line 10326 of file character.cpp.
References join(), and short_description_parts().
| std::vector< std::string > Character::short_description_parts | ( | ) | const |
Definition at line 10302 of file character.cpp.
References _, enumerate_as_string(), is_armed(), male, name, item::tname(), visible_mutations(), weapon, and worn.
Referenced by short_description().
| void Character::shout | ( | std::string | msg = "", |
| bool | order = false |
||
| ) |
Definition at line 7729 of file character.cpp.
References _, Creature::add_msg_if_player(), sounds::alert, bp_mouth, encumb(), get_shout_volume(), has_trait(), Creature::is_player(), is_wearing(), itype_id, m_warning, mod_stat(), avatar_action::move(), noise, sounds::order, pos(), shout(), sounds::sound(), trait_GILLS, trait_GILLS_CEPH, trait_PROF_FOODP, trait_SHOUT2, trait_SHOUT3, iexamine::transform(), and Creature::underwater.
Referenced by game::chat(), dialogue::dynamic_line(), shout(), suffer_from_schizophrenia(), and suffer_while_awake().
| bool Character::sight_impaired | ( | ) | const |
Returns true if the player has some form of impaired sight.
Definition at line 820 of file character.cpp.
References bio_eye_optic, bio_membrane, effect_boomered, effect_contacts, effect_darkness, effect_no_sight, has_bionic(), Creature::has_effect(), has_trait(), trait_CEPH_EYES, trait_MEMBRANE, trait_MYOPIC, trait_PER_SLIME, trait_PER_SLIME_OK, trait_SEESLEEP, trait_URSINE_EYE, Creature::underwater, and worn_with_flag().
|
overridevirtual |
Returns the player's sight range.
Implements Creature.
Definition at line 719 of file character.cpp.
References clamp(), get_map(), get_vision_threshold(), LIGHT_TRANSPARENCY_OPEN_AIR, pos(), and sight_max.
Referenced by game::calc_driving_offset(), overmap_sight_range(), sees_with_infrared(), and editmap::update_view_with_help().
|
overridevirtual |
Returns the name of the player's outer layer, e.g.
"armor plates"
Implements Creature.
Definition at line 561 of file character.cpp.
References _.
| void Character::sound_hallu | ( | ) |
Creates an auditory hallucination.
Definition at line 1705 of file suffer.cpp.
References _, add_msg(), m_warning, one_in(), sfx::play_variant_sound(), and rng().
Referenced by player::hardcoded_effects(), and suffer_from_schizophrenia().
|
overridevirtual |
Returns an approximate number of tiles this creature can travel per turn.
Implements Creature.
Reimplemented in npc.
Definition at line 9990 of file character.cpp.
References CMM_RUN, get_speed(), get_stamina(), get_stamina_max(), move_mode, cata::hash64_detail::ret, and run_cost().
| void Character::spores | ( | ) |
Definition at line 8776 of file character.cpp.
References _, sounds::combat, fungal_effects::fungalize(), g, get_map(), map::points_in_radius(), pos(), and sounds::sound().
Referenced by activate_mutation(), player::hardcoded_effects(), and suffer_while_awake().
| float Character::stamina_move_cost_modifier | ( | ) | const |
Definition at line 7257 of file character.cpp.
References CMM_CROUCH, CMM_RUN, get_stamina(), get_stamina_max(), and move_mode.
Referenced by burn_move_stamina(), and run_cost().
| void Character::start_destination_activity | ( | ) |
Definition at line 10500 of file character.cpp.
References assign_activity(), clear_destination(), debugmsg, get_destination_activity(), and has_destination_activity().
Referenced by game::handle_action(), and npc::move().
| void Character::start_hauling | ( | ) |
Definition at line 9166 of file character.cpp.
References _, add_msg(), hauling, is_armed(), and m_warning.
Referenced by haul().
| void Character::stop_hauling | ( | ) |
Definition at line 9175 of file character.cpp.
References _, ACT_MOVE_ITEMS, add_msg(), cancel_activity(), has_activity(), and hauling.
Referenced by cancel_activity(), haul(), game::place_player(), avatar::set_movement_mode(), and game::vertical_move().
|
protected |
Load variables from json into object.
These variables are common to both the avatar and NPCs.
Definition at line 648 of file savegame_json.cpp.
References _skills, activity, activity_vehicle_part_index, auto_move_route, autolearn_skills_stamp, backlog, body_wetness, consumption_history, custom_profession, destination_activity, dex_bonus, dex_cur, dex_max, JsonOut::end_array(), JsonOut::end_object(), fatigue, frostbite_timer, g, healed_total, healthy, healthy_mod, player_activity::id(), init_age, init_height, int_bonus, int_cur, int_max, is_mounted(), string_id< T >::is_valid(), known_traps, learned_recipes, magic, martial_arts_data, max_power_level, JsonOut::member(), JsonOut::member_as_string(), morale, mounted_creature, move_mode, my_bionics, my_mutations, my_traits, string_id< T >::obj(), omt_path, overmap_time, oxygen, per_bonus, per_cur, per_max, pkill, position, power_level, prof, radiation, sleep_deprivation, stamina, JsonOut::start_array(), JsonOut::start_object(), stashed_outbounds_activity, stashed_outbounds_backlog, stim, stomach, Creature::store(), stored_calories, str_bonus, str_cur, str_max, temp_conv, temp_cur, thirst, units::to_joule(), units::to_kilojoule(), to_string(), type_of_scent, Creature::underwater, vitamin_levels, JsonOut::write(), tripoint::x, tripoint::y, and tripoint::z.
Referenced by monster::serialize(), avatar::serialize(), npc::serialize(), and player::store().
| void Character::suffer | ( | ) |
Handles a large number of timers decrementing and other randomized effects.
Definition at line 1467 of file suffer.cpp.
References Creature::add_effect(), effect_accumulated_mutagen, effect_disabled, enchantment_cache, get_bionics(), Creature::get_body(), get_sleep_deprivation(), get_stim(), has_trait(), in_sleep_state(), my_mutations, num_bp, calendar::once_every(), Character::trait_data::powered, process_bionic(), sleep_deprivation, suffer_from_addictions(), suffer_from_artifacts(), suffer_from_asthma(), suffer_from_bad_bionics(), suffer_from_other_mutations(), suffer_from_radiation(), suffer_from_stimulants(), suffer_in_sunlight(), suffer_mutation_power(), suffer_water_damage(), suffer_while_awake(), suffer_while_underwater(), suffer_without_sleep(), trait_ASTHMA, and Creature::underwater.
Referenced by player::process_turn().
|
private |
Definition at line 273 of file suffer.cpp.
References addict_effect(), addictions, has_trait(), MIN_ADDICTION_LEVEL, rem_addiction(), trait_ADDICTIVE, and trait_NONADDICTIVE.
Referenced by suffer().
|
private |
Definition at line 1316 of file suffer.cpp.
References Creature::add_effect(), AEP_ATTENTION, AEP_BAD_WEATHER, AEP_FORCE_TELEPORT, AEP_MUTAGENIC, effect_attention, weather_generator::get_bad_weather(), weather_manager::get_cur_weather_gen(), get_weather(), has_artifact_with(), heavy, mutate(), calendar::once_every(), one_turn_in(), weather_manager::set_nextweather(), teleport::teleport(), calendar::turn, and weather_manager::weather_override.
Referenced by suffer().
|
private |
Definition at line 616 of file suffer.cpp.
References _, Creature::add_effect(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), asthma, bio_gills, visitable< Character >::charges_of(), effect_adrenaline, effect_asthma, effect_datura, effect_narcosis, effect_sleep, effect_took_antiasthmatic, inventory::form_from_map(), g, get_power_level(), has_bionic(), has_charges(), inventory::has_charges(), Creature::has_effect(), in_sleep_state(), Creature::is_npc(), itype_inhaler, itype_oxygen_tank, itype_smoxygen_tank, m_bad, m_info, mod_power_level(), Creature::moves, one_in(), oxygen, rng(), Creature::underwater, use_charges_if_avail(), vgettext(), and wake_up().
Referenced by suffer().
|
private |
Definition at line 1225 of file suffer.cpp.
References _, Creature::add_effect(), add_msg(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), bio_dis_acid, bio_dis_shock, bio_drain, bio_glowy, bio_itchy, bio_leaky, bio_noise, bio_power_weakness, bio_shakes, bio_sleepy, bio_spasm, bio_trip, item::charges, sfx::do_player_death_hurt(), effect_downed, effect_formication, effect_glowy_led, effect_narcosis, effect_shakes, effect_stunned, effect_visuals, g, get_max_power_level(), get_power_level(), has_bionic(), Creature::has_effect(), has_max_power(), hurtall(), in_sleep_state(), is_deaf(), itype_e_handcuffs, m_bad, m_good, m_warning, mod_fatigue(), mod_healthy_mod(), Creature::mod_pain(), mod_power_level(), mod_str_bonus(), sounds::movement, Creature::moves, num_bp, one_turn_in(), sfx::play_variant_sound(), pos(), random_body_part(), rng(), sounds::sound(), item::tname(), item::typeId(), and weapon.
Referenced by suffer().
|
private |
Definition at line 367 of file suffer.cpp.
References _, add_morale(), Creature::add_msg_if_player(), BODYTEMP_COLD, BODYTEMP_HOT, BODYTEMP_NORM, BODYTEMP_VERY_COLD, BODYTEMP_VERY_HOT, bp_eyes, effect_sleep, Creature::has_effect(), has_trait(), m_bad, m_good, mod_fatigue(), Creature::mod_pain(), mod_painkiller(), mod_stored_kcal(), mod_thirst(), MORALE_FEELING_BAD, MORALE_FEELING_GOOD, Creature::moves, one_in(), one_turn_in(), rng(), temp_cur, and trait_NOPAIN.
Referenced by suffer_while_awake().
|
private |
Definition at line 944 of file suffer.cpp.
References _, Creature::add_effect(), add_morale(), Creature::add_msg_if_player(), all_body_parts, bp_head, effect_blind, effect_deaf, effect_visuals, encumb(), fd_web, flag_PLOWABLE(), g, Creature::get_pain(), get_thirst(), has_active_mutation(), Creature::has_effect(), has_morale(), has_trait(), in_sleep_state(), in_vehicle, is_wearing_shoes(), LEFT, m_bad, m_neutral, mod_healthy_mod(), mod_thirst(), MORALE_KILLER_HAS_KILLED, MORALE_KILLER_NEED_TO_KILL, MORALE_PYROMANIA_NEARFIRE, MORALE_PYROMANIA_NOFIRE, MORALE_PYROMANIA_STARTFIRE, sounds::movement, mutate(), calendar::once_every(), one_in(), one_turn_in(), pos(), snippet_library::random_from_category(), RIGHT, rng(), Creature::set_pain(), SNIPPET, sounds::sound(), trait_CHAOTIC, trait_CHAOTIC_BAD, trait_KILLER, trait_PER_SLIME, trait_PYROMANIA, trait_ROOTS3, trait_SHARKTEETH, trait_SORES, trait_UNSTABLE, trait_WEB_SPINNER, trait_WEB_WEAVER, trait_WINGS_INSECT, turgid, vitamin_mod(), and x_in_y().
Referenced by suffer().
|
private |
Definition at line 1052 of file suffer.cpp.
References _, Creature::add_msg_if_player(), apply_damage(), bio_advreactor, bio_geiger, bio_plut_filter, bio_reactor, flag_RAD_RESIST(), units::from_kilojoule(), g, stomach_contents::get_calories(), get_healthy_mod(), get_rad(), has_active_bionic(), has_bionic(), has_trait(), healall(), hurtall(), in_sleep_state(), irradiate(), is_rad_immune(), is_wearing_power_armor(), leak_level(), m_bad, m_warning, Creature::mod_pain(), mod_power_level(), mod_rad(), mutate(), calendar::once_every(), one_in(), pos(), reactor_plut, rng(), set_healthy_mod(), set_rad(), slow_rad, stomach, tank_plut, trait_RADIOACTIVE1, trait_RADIOACTIVE2, trait_RADIOACTIVE3, trait_RADIOGENIC, vomit(), worn_with_flag(), and x_in_y().
Referenced by suffer().
|
private |
Definition at line 432 of file suffer.cpp.
References _, Creature::add_effect(), add_morale(), add_msg(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), item::damage(), drop(), effect_bleed, effect_formication, effect_hallu, effect_shakes, effect_valium, effect_visuals, snippet_library::expand(), g, Name::generate(), overmapbuffer::get_npcs_near_player(), get_skill_level(), item::get_var(), Creature::has_effect(), item::has_var(), Creature::is_npc(), item::is_null(), m_bad, m_good, m_warning, item::max_damage(), mod_painkiller(), mon_zombie, mon_zombie_cop, mon_zombie_fat, mon_zombie_fireman, mon_zombie_soldier, MORALE_FEELING_BAD, MORALE_FEELING_GOOD, name, Skill::name(), string_id< T >::obj(), one_in(), one_turn_in(), overmap_buffer, parse_tags(), pos(), random_body_part(), random_entry_ref(), snippet_library::random_from_category(), Skill::random_skill(), rng(), sees(), shout(), SNIPPET, sound_hallu(), string_format(), item::type_name(), and weapon.
Referenced by suffer_while_awake().
|
private |
Definition at line 1338 of file suffer.cpp.
References _, Creature::add_effect(), Creature::add_msg_if_player(), effect_downed, effect_nausea, effect_shakes, fall_asleep(), get_painkiller(), Creature::has_effect(), in_sleep_state(), m_bad, m_warning, mod_fatigue(), calendar::once_every(), one_turn_in(), and rng().
Referenced by suffer().
|
private |
Definition at line 809 of file suffer.cpp.
References _, Creature::add_msg_if_player(), apply_damage(), bio_sunglasses, body_part_name(), bodypart_exposure(), effect_datura, effect_sleep, flag_BLIND(), flag_SUN_GLASSES(), focus_pool, has_bionic(), Creature::has_effect(), item::has_flag(), has_trait(), m_bad, Creature::mod_pain(), one_turn_in(), trait_ALBINO, trait_SUNBURN, wake_up(), weapon, wearing_something_on(), worn_with_flag(), and x_in_y().
Referenced by suffer_in_sunlight().
|
private |
Definition at line 717 of file suffer.cpp.
References _, add_miss_reason(), armwear_factor(), stomach_contents::ate(), effect_datura, g, weather_manager::get_temperature(), get_weather(), Creature::has_effect(), has_trait(), high, mod_dex_bonus(), mod_int_bonus(), mod_per_bonus(), mod_stored_kcal(), mod_str_bonus(), normal, pos(), stomach, suffer_from_sunburn(), weather_type::sun_intensity, trait_ALBINO, trait_LEAVES, trait_LEAVES2, trait_LEAVES3, trait_SUNBURN, trait_TROGLO, trait_TROGLO2, trait_TROGLO3, vitamin_mod(), wearing_something_on(), weather_manager::weather_id, and x_in_y().
Referenced by suffer().
|
private |
Definition at line 202 of file suffer.cpp.
References _, Creature::add_msg_if_player(), apply_mods(), bmi(), Character::trait_data::charge, mutation_branch::cooldown, mutation_branch::cost, dehydrated, exhausted, mutation_branch::fatigue, get_fatigue(), get_thirst(), mutation_branch::hunger, mutation_branch::id, m_warning, mod_fatigue(), mod_stored_nutr(), mod_thirst(), mutation_branch::name(), Character::trait_data::powered, mutation_branch::thirst, and character_weight_category::underweight.
Referenced by suffer().
|
private |
suffer() subcalls
Definition at line 182 of file suffer.cpp.
References _, Creature::add_msg_player_or_npc(), apply_damage(), body_part_name(), body_wetness, drench_capacity, Creature::get_body(), heal(), m_bad, m_good, and mutation_branch::weakness_to_water.
Referenced by suffer().
|
private |
Definition at line 300 of file suffer.cpp.
References _, Creature::add_effect(), add_morale(), Creature::add_msg_player_or_npc(), AEP_SCHIZO, blossoms(), effect_downed, effect_shakes, effect_took_thorazine, fall_asleep(), get_kcal_percent(), get_stored_kcal(), has_artifact_with(), Creature::has_effect(), has_trait(), m_bad, max_stored_kcal(), MORALE_MOODSWING, num_bp, one_in(), one_turn_in(), rng(), shout(), spores(), suffer_from_chemimbalance(), suffer_from_schizophrenia(), trait_CHEMIMBALANCE, trait_DEBUG_STORAGE, trait_JITTERY, trait_M_BLOSSOMS, trait_M_SPORES, trait_MOODSWINGS, trait_NARCOLEPTIC, trait_SCHIZOPHRENIC, trait_SHOUT1, trait_SHOUT2, trait_SHOUT3, trait_VOMITOUS, vomit(), weight_capacity(), and weight_carried().
Referenced by suffer().
|
private |
Definition at line 250 of file suffer.cpp.
References _, Creature::add_msg_if_player(), apply_damage(), bio_gills, g, get_power_level(), get_thirst(), has_bionic(), has_trait(), m_bad, mod_power_level(), mod_thirst(), oxygen, pos(), rng(), trait_FRESHWATEROSMOSIS, trait_GILLS, trait_GILLS_CEPH, turgid, and worn_with_flag().
Referenced by suffer().
|
private |
Definition at line 1380 of file suffer.cpp.
References _, Creature::add_effect(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), dice(), effect_downed, effect_hallu, effect_meth, effect_nausea, effect_shakes, effect_visuals, harmless, Creature::has_effect(), m_bad, m_warning, major, minor, Creature::mod_pain(), Creature::moves, one_in(), one_turn_in(), rng(), serious, and sleep_deprivation.
Referenced by suffer().
| int Character::swim_speed | ( | ) | const |
Returns the player's speed for swimming across water tiles.
Strength increases swim speed bonus from PAWS Strength increases swim speed bonus from PAWS_LARGE Strength increases swim speed bonus from swim_fins Strength increases swim speed bonus from WEBBED Swimming increases swim speed Strength increases swim speed Dexterity increases swim speedDefinition at line 882 of file character.cpp.
References bp_hand_l, bp_hand_r, bp_leg_l, bp_leg_r, bp_torso, CMM_CROUCH, CMM_RUN, dex_cur, encumb(), exclusive_flag_coverage(), monster::get_size(), get_skill_level(), get_weight(), has_trait(), is_mounted(), mounted_creature, move_mode, mutation_value(), cata::hash64_detail::ret, skill_swimming, str_cur, monster::swims(), trait_PAWS, trait_PAWS_LARGE, trait_WEBBED, Creature::underwater, weight_carried(), worn, and worn_with_flag().
Referenced by avatar_action::move(), avatar_action::swim(), and game::vertical_move().
| void Character::switch_mutations | ( | const trait_id & | switched, |
| const trait_id & | target, | ||
| bool | start_powered | ||
| ) |
Unset switched mutation and set target mutation instead.
Definition at line 184 of file mutation.cpp.
References mutation_effect(), mutation_loss_effect(), my_mutations, set_mutation(), and unset_mutation().
Referenced by activate_mutation(), and deactivate_mutation().
|
overridevirtual |
Implements Creature.
Definition at line 514 of file character.cpp.
Referenced by anonymous_namespace{animation.cpp}::draw_hit_player_curses(), map_memory::load_legacy(), avatar::memorize_symbol(), mm_elem::operator==(), and mm_submap::serialize().
|
overridevirtual |
Color's character's tile's background.
Implements Creature.
Definition at line 6109 of file character.cpp.
References Creature::basic_symbol_color(), cyan_background(), effect_downed, effect_grabbed, map::field_at(), get_map(), green_background(), Creature::has_effect(), has_fire(), hilite(), in_sleep_state(), pos(), red_background(), and white_background().
Referenced by overmap_ui::draw_ascii(), anonymous_namespace{animation.cpp}::draw_hit_player_curses(), and game::list_monsters().
| int Character::temp_corrected_by_climate_control | ( | int | temperature | ) | const |
Value of the body temperature corrected by climate control.
Definition at line 9559 of file character.cpp.
References BODYTEMP_COLD, BODYTEMP_FREEZING, BODYTEMP_HOT, BODYTEMP_NORM, BODYTEMP_SCORCHING, BODYTEMP_VERY_COLD, and BODYTEMP_VERY_HOT.
Referenced by update_bodytemp().
| void Character::temp_equalizer | ( | const bodypart_id & | bp1, |
| const bodypart_id & | bp2 | ||
| ) |
Equalizes heat between body parts.
Definition at line 5678 of file character.cpp.
References temp_cur.
Referenced by update_bodytemp().
| int Character::throw_range | ( | const item & | it | ) | const |
Maximum thrown range with a given item, taking all active effects into account.
Strength determines maximum weight that can be thrown Strength increases throwing range, vs item weight (high or low) Strength caps throwing range Throw caps throwing rangeDefinition at line 6267 of file character.cpp.
References bio_railgun, item::charges, item::count_by_charges(), get_skill_level(), has_active_bionic(), is_mounted(), item::is_null(), item::made_of_any(), mounted_creature, cata::hash64_detail::ret, skill_throw, str_cur, item::volume(), and item::weight().
Referenced by npc::alt_attack(), target_handler::mode_throw(), and avatar_action::plthrow().
| void Character::toggle_trait | ( | const trait_id & | trait_ | ) |
Toggles a trait on the player and in their mutation list.
Definition at line 127 of file mutation.cpp.
References debugmsg, my_mutations, my_traits, set_mutation(), string_id< T >::str(), and unset_mutation().
Referenced by newcharacter::add_traits(), clear_mutations(), avatar::create(), wish_mutate_callback::key(), avatar::randomize(), npc::randomize(), reset_scenario(), set_profession(), set_traits(), and gun_actor::shoot().
| trait_id Character::trait_by_invlet | ( | int | ch | ) | const |
Returns the trait id with the given invlet, or an empty string if no trait has that invlet.
Definition at line 629 of file mutation.cpp.
References my_mutations, and string_id< mutation_branch >::NULL_ID().
Referenced by player::power_mutations_ui().
| bool Character::unarmed_attack | ( | ) | const |
True if unarmed or wielding a weapon with the UNARMED_WEAPON flag.
Definition at line 150 of file melee.cpp.
References item::has_flag(), item::is_null(), and used_weapon().
Referenced by mattack::copbot(), has_weapon(), conditional_t< T >::set_can_stow_weapon(), and conditional_t< T >::set_has_weapon().
| int Character::unimpaired_range | ( | ) | const |
Returns the player maximum vision range factoring in mutations, diseases, and other effects.
Definition at line 743 of file character.cpp.
References sight_max.
Referenced by sees().
| bool Character::uninstall_bionic | ( | const bionic & | target_cbm, |
| monster & | installer, | ||
| player & | patient, | ||
| float | adjusted_skill | ||
| ) |
Used by monster to perform surgery.
Definition at line 2082 of file bionics.cpp.
References _, Creature::add_effect(), monster::add_effect(), map::add_item(), add_msg(), monster::ammo, itype::bionic, bionic_manip_cos(), BIONIC_NOITEM_DIFFICULTY, bionics_uninstall_failure(), bionic_data::capacity, disp_name(), monster::disp_name(), effect_narcosis, effect_operating, effect_sleep, fault_bionic_nonsterile, item::faults, g, get_map(), Creature::has_effect(), bionic::id, bionic::info(), player::is_npc(), player::is_player(), string_id< T >::is_valid(), bionic_data::itype(), itype_anesthetic, itype_burnt_out_bionic, m_bad, m_mixed, m_neutral, mod_max_power_level(), bionic_data::name, monster::name(), pos(), remove_bionic(), rng(), calendar::start_of_cataclysm, and behavior::success.
| bool Character::uninstall_bionic | ( | const bionic_id & | b_id, |
| player & | installer, | ||
| bool | autodoc = false, |
||
| int | skill_level = -1 |
||
| ) |
Initialize all the values needed to start the operation player_activity.
Definition at line 1977 of file bionics.cpp.
References ACT_OPERATION, activity, Creature::add_effect(), assign_activity(), iexamine::autodoc(), bionic_manip_cos(), BIONIC_NOITEM_DIFFICULTY, bionics_adjusted_skill(), bionics_pl_skill(), bionic_data::capacity, deactivate_bionic(), effect_under_op, flag_BIONIC_WEAPON, bionic_data::has_flag(), has_trait(), bionic::info(), string_id< T >::is_valid(), bionic_data::itype(), my_bionics, bionic_data::occupied_bodyparts, perform_uninstall(), bionic::powered, rng(), skill_computer, skill_electronics, skill_firstaid, skill_mechanics, string_id< T >::str(), player_activity::str_values, behavior::success, units::to_kilojoule(), trait_DEBUG_BIONICS, type, and player_activity::values.
Referenced by iexamine::autodoc().
| void Character::unset_mutation | ( | const trait_id & | trait_ | ) |
Definition at line 167 of file mutation.cpp.
References mutation_loss_effect(), my_mutations, rebuild_mutation_cache(), recalc_sight_limits(), and reset_encumbrance().
Referenced by clear_mutations(), wish_mutate_callback::key(), marloss_common(), mutate_towards(), iuse::mycus(), remove_mutation(), talk_effect_fun_t::set_remove_trait(), switch_mutations(), test_crossing_threshold(), toggle_trait(), and try_reject_mutagen().
| void Character::update_body | ( | ) |
Updates all "biology" by one turn.
Should be called once every turn.
Definition at line 4665 of file character.cpp.
References calendar::turn, and update_body().
Referenced by game::do_turn(), npc::npc_update_body(), npc::on_load(), and update_body().
| void Character::update_body | ( | const time_point & | from, |
| const time_point & | to | ||
| ) |
Updates all "biology" as if time between from and to passed.
Definition at line 4670 of file character.cpp.
References vitamin::all(), Creature::as_player(), check_needs_extremes(), do_skill_rust(), enforce_minimum_healing(), get_rad(), has_trait(), Creature::is_npc(), magic, mend(), recalculate_enchantment_cache(), regen(), ticks_between(), trait_RADIOGENIC, update_health(), update_needs(), update_stamina(), update_stomach(), vitamin_mod(), and vitamin_rate().
| void Character::update_bodytemp | ( | const map & | m, |
| const weather_manager & | weather | ||
| ) |
Maintains body temperature.
Calculations that affect all body parts equally go here, not in the loop
Source : http://www.atc.army.mil/weather/windchill.pdf
Temperature and wind chill are main factors, mitigated by clothing warmth. Each 10 warmth protects against 2C of cold.
1200 turns in low risk, + 3 tics 450 turns in moderate risk, + 8 tics 50 turns in high risk, +72 tics
Let's say frostnip @ 1800 tics, frostbite @ 3600 tics
Chunked into 8 parts (http://imgur.com/xlTPmJF)
– 2 hour risk – Between 30F and 10F Between 10F and -5F, less than 20mph, -4x + 3y - 20 > 0, x : F, y : mph – 45 minute risk – Between 10F and -5F, less than 20mph, -4x + 3y - 20 < 0, x : F, y : mph Between 10F and -5F, greater than 20mph Less than -5F, less than 10 mph Less than -5F, more than 10 mph, -4x + 3y - 170 > 0, x : F, y : mph – 5 minute risk – Less than -5F, more than 10 mph, -4x + 3y - 170 < 0, x : F, y : mph Less than -35F, more than 10 mp
Definition at line 5183 of file character.cpp.
References _, Creature::add_effect(), add_morale(), add_msg(), bio_heatsink, body_part_arm_l, body_part_arm_r, body_part_foot_l, body_part_foot_r, body_part_hand_l, body_part_hand_r, body_part_head, body_part_leg_l, body_part_leg_r, body_part_mouth, body_part_name(), body_part_torso, body_wetness, BODYTEMP_COLD, BODYTEMP_FREEZING, BODYTEMP_HOT, bodytemp_modifier_traits(), BODYTEMP_NORM, BODYTEMP_SCORCHING, BODYTEMP_VERY_COLD, BODYTEMP_VERY_HOT, warmth::bonus_from_clothing(), can_use_floor_warmth(), convert_bp(), drench_capacity, effect_blisters, effect_cold, effect_frostbite, effect_frostbite_recovery, effect_hot, effect_hot_speed, encumb(), units::fahrenheit_to_celsius(), flag_COLLAR, flag_HOOD, flag_POCKETS, floor_warmth(), warmth::from_clothing(), warmth::from_effects(), frostbite_timer, Creature::get_all_body_parts(), get_armor_fire(), Creature::get_effect_int(), get_heat_radiation(), get_local_humidity(), get_local_windchill(), get_local_windpower(), weather_manager::get_precise(), get_weather(), global_omt_location(), has_active_mutation(), has_bionic(), Creature::has_effect(), map_data_common_t::has_flag(), has_trait(), high, w_point::humidity, in_climate_control(), in_sleep_state(), in_vehicle, weather::is_in_sunlight(), weather::is_sheltered(), is_wearing(), itype_rm13_armor_on, logarithmic_range(), m_bad, m_warning, MORALE_COMFY, MORALE_PYROMANIA_NEARFIRE, MORALE_PYROMANIA_NOFIRE, num_bp, one_in(), overmap_buffer, optional_vpart_position::part_with_feature(), pos(), rem_morale(), Creature::remove_effect(), temp_conv, temp_corrected_by_climate_control(), temp_cur, temp_equalizer(), map::ter(), overmapbuffer::ter(), body_part_set::test(), TFLAG_DEEP_WATER, TFLAG_SWIMMABLE, body_part_type::token, trait_BARK, trait_DEBUG_NOTEMP, trait_M_SKIN2, trait_M_SKIN3, trait_PYROMANIA, trait_SHELL2, calendar::turn, map::veh_at(), item::volume(), wake_up(), weapon, warmth::wind_resistance_from_clothing(), and worn.
Referenced by game::do_turn(), and iuse_transform::use().
| void Character::update_fuel_storage | ( | const itype_id & | fuel | ) |
Updates which bionic contain fuel and which is empty.
Definition at line 2122 of file character.cpp.
References get_bionic_fueled_with(), Creature::get_value(), Creature::remove_value(), Creature::set_value(), string_id< T >::str(), and cata::swap().
Referenced by burn_fuel(), and fuel_bionic_with().
|
virtual |
Handles health fluctuations over time.
Definition at line 4621 of file character.cpp.
References add_msg(), AEP_SICK, bio_leukocyte, get_healthy(), get_healthy_mod(), get_max_healthy(), has_active_bionic(), has_artifact_with(), m_debug, mod_healthy(), mod_healthy_mod(), set_healthy_mod(), and sgn().
Referenced by update_body().
| void Character::update_morale | ( | ) |
Ticks down morale counters and removes them.
Definition at line 9000 of file character.cpp.
References apply_persistent_morale(), and morale.
Referenced by game::do_turn().
| void Character::update_needs | ( | int | rate_multiplier | ) |
Increases hunger, thirst, fatigue and stimulants wearing off.
rate_multiplier is for retroactive updates.
Definition at line 4776 of file character.cpp.
References _, ACT_TRY_SLEEP, ACTION_SLEEP, activity, Creature::add_msg_if_player(), Creature::as_npc(), base_comfort_value(), bio_synaptic_regen, calc_needs_rates(), comfortable, npc::complain_about(), dead_tired, effect_lying_down, effect_melatonin_supplements, effect_narcosis, effect_recently_coughed, effect_sleep, vehicle::enclosed_at(), needs_rates::fatigue, focus_pool, g, Creature::get_effect(), get_fatigue(), get_map(), get_painkiller(), get_size(), get_stim(), has_active_bionic(), Creature::has_effect(), has_trait(), player_activity::id(), in_vehicle, is_hibernating(), Creature::is_npc(), Creature::is_player(), Character::comfort_response_t::level, m_bad, m_warning, mod_fatigue(), Creature::mod_pain(), mod_painkiller(), mod_sleep_deprivation(), MS_HUGE, vehicle::player_in_control(), pos(), press_x(), needs_rates::recovery, rng(), roll_remainder(), set_fatigue(), set_sleep_deprivation(), set_stim(), sleep(), slightly_comfortable, tired, trait_DEBUG_LS, trait_NOPAIN, veh_pointer_or_null(), and very_comfortable.
Referenced by update_body().
| void Character::update_stamina | ( | int | turns | ) |
Regenerates stamina.
Definition at line 7272 of file character.cpp.
References add_msg(), bio_gills, bp_mouth, encumb(), units::from_kilojoule(), get_power_level(), get_stamina(), get_stamina_max(), get_stim(), has_active_bionic(), m_debug, mod_power_level(), mod_stamina(), mutation_value(), roll_remainder(), set_stamina(), and units::to_kilojoule().
Referenced by update_body().
| void Character::update_stomach | ( | const time_point & | from, |
| const time_point & | to | ||
| ) |
Updates the stomach to give accurate hunger messages.
Definition at line 4733 of file character.cpp.
References bmr(), calc_needs_rates(), stomach_contents::digest(), has_trait(), needs_rates::hunger, hydrated, Creature::is_npc(), nutrients::kcal, max_stored_kcal(), mod_stored_kcal(), mod_thirst(), iuse::mycus(), food_summary::nutr, roll_remainder(), set_stored_kcal(), set_thirst(), stomach, needs_rates::thirst, ticks_between(), trait_DEBUG_LS, trait_M_DEPENDENT, trait_NO_THIRST, nutrients::vitamins, and vitamins_mod().
Referenced by update_body().
| void Character::update_type_of_scent | ( | bool | init = false | ) |
Definition at line 8726 of file character.cpp.
References g, get_mutations(), get_type_of_scent(), mutation_branch::scent_typeid, and set_type_of_scent().
Referenced by on_mutation_gain(), on_mutation_loss(), and update_type_of_scent().
| void Character::update_type_of_scent | ( | const trait_id & | mut, |
| bool | gain = true |
||
| ) |
Definition at line 8741 of file character.cpp.
References g, get_type_of_scent(), mutation_branch::scent_typeid, set_type_of_scent(), update_type_of_scent(), and cata::optional< T >::value().
| void Character::update_vitamins | ( | const vitamin_id & | vit | ) |
Set vitamin deficiency/excess disease states dependent upon current vitamin levels.
Definition at line 8800 of file character.cpp.
References Creature::add_effect(), vitamin::deficiency(), vitamin::excess(), Creature::get_effect(), Creature::has_effect(), Creature::is_npc(), num_bp, string_id< T >::obj(), Creature::remove_effect(), effect::set_intensity(), vitamin::severity(), and vitamin_get().
Referenced by vitamin_mod().
| std::list< item > Character::use_amount | ( | itype_id | it, |
| int | quantity, | ||
| const std::function< bool(const item &)> & | filter = return_true<item> |
||
| ) |
Definition at line 9626 of file character.cpp.
References a, inv, remove_weapon(), cata::hash64_detail::ret, item::use_amount(), inventory::use_amount(), weapon, and worn.
Referenced by computer_session::action_srcf_elevator(), iexamine::cardreader(), iexamine::cardreader_robofac(), player::consume_items(), game::find_or_make_stairs(), hack_attempt(), iexamine::pedestal_temple(), activity_handlers::plant_seed_finish(), vehicle::reload_seeds(), talk_effect_fun_t::set_consume_item(), talk_effect_fun_t::set_u_sell_item(), sinkhole_safety_roll(), and npc_trading::transfer_items().
| std::list< item > Character::use_charges | ( | const itype_id & | what, |
| int | qty, | ||
| const std::function< bool(const item &)> & | filter = return_true<item> |
||
| ) |
Definition at line 9658 of file character.cpp.
References ABORT, bio_ups, visitable< Character >::charges_of(), debugmsg, flag_BIONIC_ARMOR_INTERFACE, flag_USE_UPS(), units::from_kilojoule(), get_power_level(), has_active_bionic(), item::has_flag(), has_power(), is_mounted(), itype_adv_UPS_off, itype_bio_armor, itype_fire, itype_toolset, itype_UPS, itype_UPS_off, MF_RIDEABLE_MECH, mod_power_level(), mounted_creature, my_bionics, pos(), visitable< Character >::remove_item(), SKIP, units::to_kilojoule(), item::typeId(), item::use_charges(), use_charges(), use_fire(), and visitable< Character >::visit_items().
Referenced by iexamine::arcfurnace_empty(), consume_charges(), player::consume_items(), player::consume_med(), consume_remote_fuel(), player::consume_tools(), player::eat(), iuse::ecig(), iexamine::fertilize_plant(), player::fire_gun(), iexamine::fireplace(), iexamine::fvat_empty(), activity_handlers::gunmod_add_finish(), hack_attempt(), iexamine::keg(), iexamine::kiln_empty(), iexamine::pay_gas(), activity_handlers::plant_seed_finish(), player::process_items(), iexamine::reload_furniture(), vehicle::reload_seeds(), talk_effect_fun_t::set_bulk_trade_accept(), talk_effect_fun_t::set_consume_item(), talk_effect_fun_t::set_u_sell_item(), smoker_activate(), npc_trading::transfer_items(), try_consume(), try_start_hacking(), consume_drug_iuse::use(), place_monster_iuse::use(), cauterize_actor::use(), use_charges(), use_charges_if_avail(), use_fire(), and iexamine::vending().
| bool Character::use_charges_if_avail | ( | const itype_id & | it, |
| int | quantity | ||
| ) |
Definition at line 9649 of file character.cpp.
References has_charges(), and use_charges().
Referenced by iuse::arrow_flammable(), iuse::firecracker(), activity_handlers::game_do_turn(), iuse::meth(), iuse::note_bionics(), item::process_tool(), item::reload(), iuse::smoking(), suffer_from_asthma(), and iuse_transform::use().
| void Character::use_fire | ( | int | quantity | ) |
Definition at line 9809 of file character.cpp.
References all_items_with_flag(), bio_laser, bio_lighter, bio_tools, get_map(), get_power_level(), has_active_bionic(), has_bionic(), has_charges(), has_item_with_flag(), mod_power_level(), pos(), and use_charges().
Referenced by use_charges().
| item & Character::used_weapon | ( | ) |
Definition at line 140 of file melee.cpp.
References used_weapon().
| const item & Character::used_weapon | ( | ) | const |
Returns a reference to the item which will be used to make attacks.
At the moment it's always weapon or a reference to a null item.
Definition at line 135 of file melee.cpp.
References martial_arts_data, null_item_reference(), and weapon.
Referenced by get_melee_hit_base(), ma_requirements::is_valid_character(), melee_attack(), player::on_dodge(), unarmed_attack(), and used_weapon().
|
private |
Check if an area-of-effect technique has valid targets.
Definition at line 1218 of file melee.cpp.
References valid_aoe_technique().
Referenced by perform_technique(), pick_technique(), and valid_aoe_technique().
|
private |
Definition at line 1224 of file melee.cpp.
References ma_technique::aoe, monster::friendly, g, npc::is_enemy(), left, Creature::pos(), pos(), Creature::posx(), posx(), Creature::posy(), posy(), and right.
| int Character::visibility | ( | bool | check_color = false, |
| int | stillness = 0 |
||
| ) | const |
Checks is_invisible() as well as other factors.
Definition at line 6359 of file character.cpp.
References clamp(), is_invisible(), and mutation_value().
| std::string Character::visible_mutations | ( | int | visibility_cap | ) | const |
Returns an enumeration of visible mutations with colors.
Definition at line 1753 of file mutation.cpp.
References enumerate_as_string(), and get_mutations().
Referenced by npc::print_info(), and short_description_parts().
| int Character::vitamin_get | ( | const vitamin_id & | vit | ) | const |
Check current level of a vitamin.
Accesses level of a given vitamin. If the vitamin_id specified does not exist then this function simply returns 0.
| vit | ID of vitamin to check level for. |
Definition at line 573 of file consumption.cpp.
References vitamin::type(), VITAMIN, and vitamin_levels.
Referenced by debug_menu::character_edit_menu(), eff_fun_mutating(), and update_vitamins().
| int Character::vitamin_mod | ( | const vitamin_id & | vit, |
| int | qty, | ||
| bool | capped = true |
||
| ) |
Add or subtract vitamins from character storage pools.
| vit | ID of vitamin to modify |
| qty | amount by which to adjust vitamin (negative values are permitted) |
| capped | if true prevent vitamins which can accumulate in excess from doing so |
Definition at line 541 of file consumption.cpp.
References debugmsg, string_id< T >::is_valid(), vitamin::max(), vitamin::min(), string_id< T >::str(), update_vitamins(), and vitamin_levels.
Referenced by eff_fun_bleed(), rooted(), suffer_from_other_mutations(), suffer_in_sunlight(), update_body(), consume_drug_iuse::use(), vitamin_set(), and vitamins_mod().
| time_duration Character::vitamin_rate | ( | const vitamin_id & | vit | ) | const |
Get vitamin usage rate (minutes per unit) accounting for bionics, mutations and effects.
Definition at line 526 of file consumption.cpp.
References get_mutations(), string_id< T >::obj(), and vitamin::rate().
Referenced by update_body(), and consume_drug_iuse::use().
| bool Character::vitamin_set | ( | const vitamin_id & | vit, |
| int | qty | ||
| ) |
Sets level of a vitamin or returns false if id given in vit does not exist.
| [in] | vit | ID of vitamin to adjust quantity for |
| [in] | qty | Quantity to set level to |
Definition at line 583 of file consumption.cpp.
References vitamin_levels, and vitamin_mod().
Referenced by debug_menu::character_edit_menu(), eff_fun_mutating(), and eff_fun_toxin_buildup().
| void Character::vitamins_mod | ( | const std::map< vitamin_id, int > & | vitamins, |
| bool | capped = true |
||
| ) |
Definition at line 566 of file consumption.cpp.
References vitamin_mod().
Referenced by update_stomach().
| units::volume Character::volume_capacity | ( | ) | const |
Definition at line 2851 of file character.cpp.
References volume_capacity_reduced_by().
Referenced by apply_persistent_morale(), are_requirements_nearby(), can_pick_volume(), carry_volume_string(), dispose_item(), npc::dispose_item(), pickup::do_pickup(), draw_weightvolume_labels(), drop_invalid_inventory(), npc::drop_items(), fetch_activity(), npc::find_item(), inventory_selector::get_raw_stats(), item::get_remaining_capacity_for_liquid(), give_item_to(), npc_pickup_from_stack(), trading_window::perform_trade(), npc::shop_restock(), npc::stow_item(), iuse::wash_all_items(), iuse::wash_hard_items(), and iuse::wash_soft_items().
| units::volume Character::volume_capacity_reduced_by | ( | const units::volume & | mod, |
| const excluded_stacks & | without = {} |
||
| ) | const |
Definition at line 2856 of file character.cpp.
References bio_storage, has_active_mutation(), has_bionic(), has_trait(), cata::hash64_detail::ret, trait_DEBUG_STORAGE, trait_DISORGANIZED, trait_PACKMULE, trait_SHELL, trait_SHELL2, units::volume_max, and worn.
Referenced by inventory_drop_selector::get_raw_stats(), pickup::reorder_for_dropping(), player::takeoff(), and volume_capacity().
| units::volume Character::volume_carried | ( | ) | const |
Definition at line 2724 of file character.cpp.
References inv, and inventory::volume().
Referenced by apply_persistent_morale(), are_requirements_nearby(), carry_volume_string(), dispose_item(), npc::dispose_item(), pickup::do_pickup(), draw_weightvolume_labels(), drop_invalid_inventory(), npc::drop_items(), fetch_activity(), npc::find_item(), inventory_selector::get_raw_stats(), item::get_remaining_capacity_for_liquid(), give_item_to(), npc_pickup_from_stack(), trading_window::perform_trade(), pickup::reorder_for_dropping(), npc::stow_item(), player::takeoff(), iuse::wash_all_items(), iuse::wash_hard_items(), and iuse::wash_soft_items().
| units::volume Character::volume_carried_reduced_by | ( | const excluded_stacks & | without | ) | const |
Definition at line 2798 of file character.cpp.
References inv, inventory::volume(), and inventory::volume_without().
Referenced by inventory_drop_selector::get_raw_stats().
| void Character::vomit | ( | ) |
Handles Character vomiting effects.
Definition at line 7794 of file character.cpp.
References _, Creature::add_effect(), Creature::add_msg_player_or_npc(), adjacent_tile(), effect_bloated, effect_drunk, effect_foodpoison, effect_fungus, effect_nausea, effect_pkill1, effect_pkill2, effect_pkill3, stomach_contents::empty(), fd_bile, fungal_effects::fungalize(), g, stomach_contents::get_calories(), Creature::get_effect(), Creature::get_effect_int(), get_healthy_mod(), effect::get_int_dur_factor(), get_map(), effect::get_max_duration(), get_thirst(), getID(), Creature::has_effect(), m_bad, effect::mod_duration(), Creature::moves, string_id< body_part_type >::NULL_ID(), string_id< T >::obj(), pos(), Creature::remove_effect(), rng(), set_healthy_mod(), set_thirst(), stomach, throws_up, calendar::turn, and wake_up().
Referenced by activate_mutation(), addict_effect(), iuse::artifact(), iuse::blech(), iuse::dig(), player::eat(), eff_fun_hallu(), eff_fun_hot(), eff_fun_rat(), player::hardcoded_effects(), marloss_common(), iuse::mycus(), player::process_effects_internal(), player::process_one_effect(), iuse::sewage(), suffer_from_radiation(), suffer_while_awake(), try_reject_mutagen(), avatar::vomit(), and spell_effect::vomit().
| void Character::wait_effects | ( | ) |
Definition at line 1586 of file character.cpp.
References effect_beartrap, effect_downed, effect_grabbed, effect_heavysnare, effect_lightsnare, effect_webbed, Creature::has_effect(), try_remove_bear_trap(), try_remove_downed(), try_remove_grab(), try_remove_heavysnare(), try_remove_lightsnare(), and try_remove_webs().
| void Character::wake_up | ( | ) |
Removes "sleep" and "lying_down".
Definition at line 7673 of file character.cpp.
References character_wakes_up, effect_alarm_clock, effect_lying_down, effect_sleep, effect_slept_through_alarm, g, getID(), Creature::has_effect(), recalc_sight_limits(), and Creature::remove_effect().
Referenced by player::hardcoded_effects(), on_hurt(), sounds::process_sound_markers(), react_to_felt_pain(), Creature::remove_effect(), suffer_from_asthma(), suffer_from_sunburn(), update_bodytemp(), vomit(), and avatar::wake_up().
| std::map< bodypart_id, int > Character::warmth | ( | const std::map< bodypart_id, std::vector< const item * > > & | clothing_map | ) | const |
Returns warmth provided by armor, etc.
Definition at line 9372 of file character.cpp.
References body_wetness, drench_capacity, effect_heating_bionic, Creature::get_all_body_parts(), Creature::get_effect_int(), item::get_warmth(), item::made_of(), and cata::hash64_detail::ret.
Referenced by weather_effect::wet_player().
| cata::optional< std::list< item >::iterator > Character::wear_item | ( | const item & | to_wear, |
| bool | interactive = true |
||
| ) |
Wear item; returns nullopt on fail, or pointer to newly worn item on success.
If interactive is false, don't alert the player or drain moves on completion.
Definition at line 2181 of file character.cpp.
References _, Creature::add_msg_if_npc(), Creature::add_msg_if_player(), Creature::add_msg_player_or_npc(), all_body_parts, body_part_name(), bp_eyes, can_wear(), item::covers(), encumb(), encumb_text(), flag_UNDERSIZE(), get_size(), item::has_flag(), inv, is_deaf(), item_wear_cost(), last_item, m_info, m_warning, Creature::moves, MS_TINY, cata::nullopt, position, position_to_wear_new_item(), recalc_sight_limits(), reset_encumbrance(), cata::hash64_detail::ret, item::tname(), item::typeId(), inventory::update_cache_with_item(), inventory::update_invlet(), and worn.
Referenced by activity_on_turn_wear(), iexamine::autodoc(), avatar::create(), dispose_item(), pick_one_up(), standard_npc::standard_npc(), npc::stow_item(), player::use(), player::wear(), and npc::wear_if_wanted().
| bool Character::wearing_something_on | ( | const bodypart_id & | bp | ) | const |
Returns true if the character is wearing something on the entered body part.
Definition at line 8859 of file character.cpp.
References worn.
Referenced by armwear_factor(), can_drink_nectar(), can_wear(), iexamine::chainfence(), footwear_factor(), player::on_hit(), player::reset_stats(), suffer_from_sunburn(), and suffer_in_sunlight().
|
overridevirtual |
Reimplemented from Creature.
Definition at line 2807 of file character.cpp.
References AEP_CARRY_MORE, get_bionics(), get_str(), has_artifact_with(), has_trait(), is_mounted(), units::mass_max, mounted_creature, mutation_value(), cata::hash64_detail::ret, trait_DEBUG_STORAGE, Creature::weight_capacity(), and worn.
Referenced by activate_bionic(), are_requirements_nearby(), burn_move_stamina(), can_pick_weight(), carry_weight_string(), pickup::cost_to_move_item(), overmap_ui::display(), pickup::do_pickup(), draw_speed_tab(), draw_stats_info(), draw_weightvolume_labels(), npc::drop_items(), fetch_activity(), find_best_bench(), npc::find_item(), inventory_selector::get_raw_stats(), inventory_drop_selector::get_raw_stats(), iexamine::ledge(), npc_pickup_from_stack(), trading_window::perform_trade(), player::recalc_speed_bonus(), set_stats(), suffer_while_awake(), and weight_carried_reduced_by().
| units::mass Character::weight_carried | ( | ) | const |
Definition at line 2719 of file character.cpp.
References weight_carried_reduced_by().
Referenced by are_requirements_nearby(), burn_move_stamina(), can_pick_weight(), carry_weight_string(), overmap_ui::display(), pickup::do_pickup(), draw_speed_tab(), draw_weightvolume_labels(), npc::drop_items(), fetch_activity(), npc::find_item(), inventory_selector::get_raw_stats(), iexamine::ledge(), npc_pickup_from_stack(), trading_window::perform_trade(), player::recalc_speed_bonus(), suffer_while_awake(), and swim_speed().
| units::mass Character::weight_carried_reduced_by | ( | const excluded_stacks & | without | ) | const |
Definition at line 2750 of file character.cpp.
References best_nearby_lifting_assist(), item::charges, item::count_by_charges(), debugmsg, g, inv, cata::hash64_detail::ret, TOOL_LIFT_FACTOR, weapon, item::weight(), weight_capacity(), inventory::weight_without(), and worn.
Referenced by inventory_drop_selector::get_raw_stats(), and weight_carried().
|
pure virtual |
Removes currently wielded item (if any) and replaces it with the target item.
| target | replacement item to wield or null item to remove existing weapon without replacing it |
Implemented in npc, and avatar.
Referenced by player::disarm(), handle_melee_wear(), mount_creature(), perform_technique(), pick_one_up(), and mattack::riotbot().
| ret_val< edible_rating > Character::will_eat | ( | const item & | food, |
| bool | interactive = false |
||
| ) | const |
Same as can_eat, but takes consequences into account.
Asks about them if
| interactive | is true, refuses otherwise. |
Definition at line 725 of file consumption.cpp.
References _, Creature::add_msg_if_player(), allergy, allergy_type(), allergy_weak, bio_digestion, bloated, can_eat(), cannibalism, item::color_in_inventory(), colorize(), comesttype_DRINK(), comesttype_FOOD(), compute_effective_nutrients(), edible, effect_bloated, effect_nausea, flag_ALLERGEN_JUNK(), flag_CANNIBALISM(), flag_CARNIVORE_OK(), flag_FERTILIZER(), flag_NO_BLOAT(), flag_USE_EAT_VERB(), stomach_contents::get_calories(), item::get_comestible(), get_stored_kcal(), get_thirst(), has_bionic(), Creature::has_effect(), item::has_flag(), item::has_infinite_charges(), has_trait(), has_trait_flag(), nutrients::kcal, m_info, ret_val< T >::make_success(), max_stored_kcal(), MORALE_NULL, nausea, query_yn(), cata::hash64_detail::ret, rotten, item::rotten(), stomach, string_format(), item::tname(), too_full, trait_CARNIVORE, trait_SAPROPHAGE, and trait_SAPROVORE.
Referenced by item::color_in_inventory(), npc::consume_food(), player::eat(), find_auto_consume(), examine_item_menu::rate_action_eat(), and npc::value().
|
inlinestatic |
Definition at line 1077 of file character.h.
References position.
Referenced by advanced_inventory::action_examine(), get_item_position(), i_at(), i_rem(), and avatar_action::wield().
| bool Character::worn_with_flag | ( | const std::string & | flag, |
| const bodypart_id & | bp = bodypart_str_id::NULL_ID() |
||
| ) | const |
Returns true if the player is wearing an item with the given flag.
Definition at line 3270 of file character.cpp.
References worn.
Referenced by iexamine::autodoc(), body_window(), iuse::cable_attach(), calc_needs_rates(), npc::can_read(), can_wear(), player::can_wield(), player::crafting_success_roll(), draw_limb_health(), iuse::einktabletpc(), avatar::get_book_reader(), get_dodge(), get_miss_reason(), ranged::gunmode_checks_common(), hardcoded_mutation_attack(), has_nv(), hit_roll(), irradiate(), is_blind(), is_deaf(), is_immune_damage(), is_immune_effect(), is_rad_immune(), mend(), iuse::multicooker(), player::on_hit(), item::on_wear(), game::phasing_move(), map::player_in_field(), game::print_items_info(), item::process_cable(), recalc_sight_limits(), iuse::robotcontrol(), run_cost(), sight_impaired(), iuse::solarpack(), suffer_from_radiation(), suffer_from_sunburn(), suffer_while_underwater(), swim_speed(), teleport::teleport(), game::use_computer(), game::vertical_move(), and weather_effect::wet_player().
|
protected |
Character skills.
Definition at line 2097 of file character.h.
Referenced by npc::best_skill(), npc::best_skill_level(), clear_skills(), do_skill_rust(), get_all_skills(), get_learned_recipes(), get_skill_level(), get_skill_level_object(), load(), meets_skill_requirements(), mod_skill_level(), player::practice(), npc::skills_offered_to(), and store().
| player_activity Character::activity |
Definition at line 1516 of file character.h.
Referenced by activate_mutation(), activity_on_turn_move_loot(), assign_activity(), assign_stashed_activity(), iexamine::autodoc(), activity_handlers::build_do_turn(), iuse::burrow(), game::butcher(), butcher_corpse_activity(), player::calc_focus_equilibrium(), cancel_activity(), game::cancel_activity_or_ignore_query(), game::cancel_activity_query(), check_outbounds_activity(), iuse::chop_logs(), chop_plank_activity(), iuse::chop_tree(), chop_tree_activity(), iuse::clear_rubble(), complete_construction(), veh_interact::complete_vehicle(), construction_activity(), iuse::craft(), iuse::cut_log_into_planks(), npc::do_player_activity(), npc::do_pulp(), avatar::do_read(), game::do_turn(), player_activity::do_turn(), pickup_activity_actor::do_turn(), npc::drop(), eff_fun_bleed(), fall_asleep(), fetch_activity(), iuse::fill_pit(), activity_handlers::find_mount_do_turn(), npc::finish_read(), iuse::fishing_rod(), forced_dismount(), game::forced_door_closing(), generic_multi_activity_check_requirement(), generic_multi_activity_do(), generic_multi_activity_handler(), player_activity::get_progress_message(), talk_function::give_aid(), talk_function::give_all_aid(), player::gunmod_add(), iuse::hacksaw(), iuse::hand_crank(), game::handle_key_blocking_activity(), player::hardcoded_effects(), has_activity(), npc::has_player_activity(), in_sleep_state(), install_bionics(), vehicle::interact_with(), inv_internal(), iuse::jackhammer(), load(), npc::load(), iuse::makemound(), mine_activity(), npc::move(), map::move_vehicle(), npc::on_load(), iuse::oxytorch(), perform_zone_activity_turn(), iuse::pickaxe(), game::place_player(), iuse::portable_game(), game::process_activity(), sounds::process_sound_markers(), player::process_turn(), game::process_voluntary_act_interrupt(), avatar::read(), npc::reboot(), avatar_action::reload(), DefaultRemovePartHandler::removed(), activity_handlers::repair_item_finish(), resume_backlog_activity(), npc::revert_after_activity(), iexamine::rubble(), iexamine::safe(), conditional_t< T >::set_has_activity(), npc::set_mission(), iexamine::shrub_wildveggies(), smash(), player::start_craft(), store(), player::toolmod_add(), iexamine::trap(), try_start_hacking(), uninstall_bionic(), update_needs(), pick_lock_actor::use(), firestarter_actor::use(), enzlave_actor::use(), ammobelt_actor::use(), repair_item_actor::use(), heal_actor::use(), heal_actor::use_healing_item(), vehicle_activity(), and iuse::vibe().
| int Character::activity_vehicle_part_index = -1 |
Definition at line 1560 of file character.h.
Referenced by can_do_activity_there(), generic_multi_activity_check_requirement(), generic_multi_activity_do(), generic_multi_activity_handler(), load(), store(), and vehicle_activity().
| std::vector<addiction> Character::addictions |
Definition at line 1546 of file character.h.
Referenced by add_addiction(), addiction_level(), avatar::create(), character_display::disp_info(), player::environmental_revert_effect(), has_addiction(), player::load(), rem_addiction(), player::store(), and suffer_from_addictions().
| item_location Character::ammo_location |
Definition at line 1541 of file character.h.
Referenced by player::load(), and player::store().
|
private |
Definition at line 2189 of file character.h.
Referenced by clear_destination(), defer_move(), get_auto_move_route(), get_next_auto_move_direction(), has_destination(), load(), set_destination(), shift_destination(), and store().
|
mutableprotected |
Stamp of character skills.
learned_recipes are valid only with this set of skills.
Definition at line 2099 of file character.h.
Referenced by get_learned_recipes(), load(), and store().
| std::list<player_activity> Character::backlog |
Definition at line 1517 of file character.h.
Referenced by are_requirements_nearby(), assign_activity(), assign_stashed_activity(), butchery_drops_harvest(), cancel_activity(), game::cancel_activity_or_ignore_query(), check_outbounds_activity(), activity_handlers::chop_tree_finish(), complete_construction(), construction_activity(), npc::do_player_activity(), migration_cancel_activity_actor::do_turn(), fetch_activity(), activity_handlers::fish_finish(), generic_multi_activity_check_requirement(), generic_multi_activity_do(), generic_multi_activity_handler(), load(), requirements_map(), resume_backlog_activity(), activity_handlers::resume_for_multi_activities(), npc::revert_after_activity(), and store().
|
protected |
Definition at line 2071 of file character.h.
| int Character::blocks_left = 0 |
Definition at line 558 of file character.h.
Referenced by block_hit(), player::player(), and player::process_turn().
| std::array<int, num_bp> Character::body_wetness |
Definition at line 2211 of file character.h.
Referenced by apply_wetness_morale(), check_art_charge_req(), drench(), load(), store(), suffer_water_damage(), iuse::towel_common(), player::update_body_wetness(), update_bodytemp(), and warmth().
|
private |
Definition at line 2198 of file character.h.
Referenced by crafting_inventory().
|
mutableprotected |
Definition at line 2070 of file character.h.
Referenced by npc::find_reloadable(), i_add(), remove_weapon(), player::weapon_value(), npc::wield(), and avatar::wield().
|
private |
Definition at line 2196 of file character.h.
Referenced by crafting_inventory().
|
protected |
Pointers to mutation branches in my_mutations.
Definition at line 2090 of file character.h.
Referenced by clear_mutations(), get_mutation_social_mods(), load(), mutation_value(), rebuild_mutation_cache(), recalc_sight_limits(), and recalculate_size().
|
private |
Definition at line 2197 of file character.h.
Referenced by crafting_inventory(), and invalidate_crafting_inventory().
| time_point Character::cached_time |
Definition at line 1544 of file character.h.
Referenced by crafting_inventory(), and invalidate_crafting_inventory().
| std::set<tripoint_abs_omt> Character::camps |
Definition at line 1542 of file character.h.
Referenced by npc::consume_food_from_camp(), talk_function::goto_location(), player::load(), and player::store().
| int Character::cash = 0 |
Definition at line 1536 of file character.h.
Referenced by talk_function::field_build_1(), talk_function::field_build_2(), player::load(), npc::mug_player(), and player::store().
|
private |
Definition at line 2182 of file character.h.
Referenced by check_item_encumbrance_flag(), flag_encumbrance(), get_check_encumbrance(), and set_check_encumbrance().
| pimpl<consumption_history_t> Character::consumption_history |
Definition at line 1528 of file character.h.
Referenced by player::eat(), fun_for(), load(), and store().
| bool Character::controlling_vehicle = false |
Definition at line 228 of file character.h.
Referenced by game::butcher(), game::check_safe_mode_allowed(), game::control_vehicle(), overmap_ui::display(), game::do_turn(), autodrive_activity_actor::do_turn(), game::draw_ter(), game::handle_action(), avatar::load(), player::player(), vehicle::player_in_control(), pldrive(), sounds::process_sound_markers(), player::search_surroundings(), autodrive_activity_actor::start(), activity_handlers::start_engines_finish(), avatar::store(), map::unboard_vehicle(), vehicle::use_controls(), and wait().
| std::string Character::custom_profession |
Definition at line 564 of file character.h.
Referenced by character_display::disp_info(), draw_tip(), handle_player_display_action(), load(), and store().
| std::array<int, num_hp_parts> Character::damage_bandaged |
Definition at line 1508 of file character.h.
Referenced by heal_actor::finish_using(), load(), regen(), and player::store().
| std::array<int, num_hp_parts> Character::damage_disinfected |
Definition at line 1508 of file character.h.
Referenced by iexamine::autodoc(), heal_actor::finish_using(), load(), regen(), and player::store().
| bool Character::death_drops = true |
Definition at line 226 of file character.h.
Referenced by npc::npc(), place_corpse(), and player::player().
|
private |
Definition at line 2167 of file character.h.
Referenced by clear_destination_activity(), get_destination_activity(), load(), set_destination_activity(), and store().
| cata::optional<tripoint> Character::destination_point |
Definition at line 1518 of file character.h.
Referenced by clear_destination(), has_destination_activity(), is_auto_moving(), player::load(), npc::move(), npc::move_to(), set_destination(), and player::store().
|
protected |
Definition at line 2053 of file character.h.
Referenced by get_dex(), get_dex_bonus(), load(), mod_dex_bonus(), reset_bonuses(), set_dex_bonus(), and store().
| int Character::dex_cur = 0 |
Definition at line 248 of file character.h.
Referenced by attack_cost(), player::avoid_trap(), activity_handlers::butcher_finish(), iexamine::chainfence(), iuse::chop_moves(), crit_chance(), salvage_actor::cut_up(), mattack::dermatik(), player::fall_damage_mod(), fungal_effects::fungalize(), game::get_dangerous_tile(), vehicle::get_targeting_npc(), handle_melee_wear(), load(), activity_handlers::lockpicking_finish(), make_fake_npc(), mod_dex_bonus(), game::place_player(), player::player(), vehicle::pldrive(), game::process_artifact(), repair_item_actor::repair_chance(), reset_stats(), mattack::riotbot(), set_dex_bonus(), conditional_t< T >::set_has_dexterity(), map::shake_vehicle(), sinkhole_safety_roll(), game::slip_down(), standard_npc::standard_npc(), store(), swim_speed(), iuse::tazer(), mattack::thrown_by_judo(), trapfunc::tripwire(), pick_lock_actor::use(), enzlave_actor::use(), sew_advanced_actor::use(), game::vertical_move(), game::walk_move(), and memorial_logger::write().
| int Character::dex_max = 0 |
Definition at line 243 of file character.h.
Referenced by apply_mods(), apply_skill_boost(), debug_menu::character_edit_menu(), get_dex_base(), load(), mod_dex_bonus(), mutation_effect(), mutation_loss_effect(), npc::npc(), player::player(), avatar::randomize(), npc::randomize(), reset_scenario(), reset_stats(), set_description(), set_dex_bonus(), set_stats(), standard_npc::standard_npc(), store(), and memorial_logger::write().
| int Character::dodges_left = 0 |
Definition at line 559 of file character.h.
Referenced by get_dodge(), game::is_game_over(), player::on_dodge(), player::player(), and player::process_turn().
| std::array<int, num_bp> Character::drench_capacity |
Definition at line 2212 of file character.h.
Referenced by drench(), suffer_water_damage(), player::update_body_wetness(), update_bodytemp(), and warmth().
|
protected |
Definition at line 2203 of file character.h.
Referenced by bonus_from_enchantments(), did_hit(), get_mutations(), has_trait(), on_hit(), rebuild_mutation_cache(), player::recalc_speed_bonus(), recalculate_enchantment_cache(), and suffer().
|
protected |
Definition at line 2069 of file character.h.
Referenced by encumb(), extraEncumbrance(), get_encumbrance(), and reset_encumbrance().
|
protected |
Definition at line 2125 of file character.h.
Referenced by npc::get_fac_id(), npc::good_escape_direction(), npc::handle_sound(), npc::load(), player::load(), npc::load_npc_template(), npc::npc(), npc::set_fac(), set_fac_id(), and npc::store().
|
protected |
Definition at line 2123 of file character.h.
Referenced by npc::get_faction_ver(), npc::is_ally(), npc::load(), npc::set_faction_ver(), and npc::store().
|
private |
Definition at line 2180 of file character.h.
Referenced by get_fatigue(), get_fatigue_description(), load(), mod_fatigue(), set_fatigue(), and store().
|
static |
Definition at line 768 of file character.h.
Referenced by made_of(), and made_of_any().
| int Character::focus_pool = 0 |
Definition at line 1535 of file character.h.
Referenced by addict_effect(), adjust_for_focus(), player::calc_focus_change(), draw_char_narrow(), draw_char_wide(), draw_health_classic(), draw_needs_compact(), player::gunmod_installation_odds(), player::hardcoded_effects(), avatar::load(), marloss_add(), player::player(), player::practice(), spell::spell_fail(), avatar::store(), suffer_from_sunburn(), player::update_mental_focus(), and update_needs().
| std::set<character_id> Character::follower_ids |
Definition at line 1537 of file character.h.
Referenced by player::load(), and player::store().
| std::array<int, num_bp> Character::frostbite_timer |
Definition at line 2210 of file character.h.
Referenced by load(), store(), and update_bodytemp().
| bool Character::hauling = false |
Definition at line 1512 of file character.h.
Referenced by is_hauling(), player::player(), start_hauling(), and stop_hauling().
| std::array<int, num_hp_parts> Character::healed_total |
Definition at line 1717 of file character.h.
Referenced by healed_bp(), load(), and store().
|
protected |
How healthy the character is.
Definition at line 2058 of file character.h.
Referenced by get_healthy(), load(), mod_healthy(), set_healthy(), and store().
|
protected |
Definition at line 2059 of file character.h.
Referenced by get_healthy_mod(), load(), mod_healthy_mod(), set_healthy_mod(), and store().
|
private |
Definition at line 2169 of file character.h.
Referenced by player::add_faction_warning(), bionics_install_failure(), basecamp::deserialize(), getID(), player::hardcoded_effects(), has_mabuff(), item::io(), Creature::load(), set_traits(), and set_type_of_scent().
| bool Character::in_vehicle = false |
Definition at line 1511 of file character.h.
Referenced by map::board_vehicle(), iexamine::chainfence(), check_art_charge_req(), game::control_vehicle(), map::creature_in_field(), map::creature_on_trap(), map::crush(), advanced_inv_pane_save_state::deserialize(), npc::die(), overmap_ui::display(), game::do_turn(), autodrive_activity_actor::do_turn(), draw_health_classic(), draw_veh_compact(), draw_veh_padding(), vehicle::drive_to_local_target(), npc::find_corpse_to_pulp(), game::fling_creature(), game::get_dangerous_tile(), mattack::grab_drag(), game::handle_action(), npc::handle_sound(), game::is_game_over(), is_snuggling(), player::load(), game::load(), npc::method_of_attack(), npc::method_of_fleeing(), npc::move(), npc::move_to(), npc::on_load(), vehicle::part_collision(), player::pause(), game::phasing_move(), game::place_player(), game::place_player_overmap(), player::player(), map::player_in_field(), pldrive(), item::process_extinguish(), mattack::ranged_pull(), recoil_vehicle(), advanced_inv_pane_save_state::serialize(), autodrive_activity_actor::start(), player::store(), suffer_from_other_mutations(), game::swap_critters(), avatar_action::swim(), map::unboard_vehicle(), update_bodytemp(), and update_needs().
|
protected |
age in years at character creation
Definition at line 2062 of file character.h.
Referenced by age(), base_age(), load(), mod_base_age(), avatar::randomize(), reset_chargen_attributes(), set_base_age(), and store().
|
protected |
height at character creation
Definition at line 2064 of file character.h.
Referenced by base_height(), height(), load(), mod_base_height(), avatar::randomize(), reset_chargen_attributes(), set_base_height(), and store().
|
protected |
Definition at line 2055 of file character.h.
Referenced by get_int(), get_int_bonus(), load(), mod_int_bonus(), reset_bonuses(), set_int_bonus(), and store().
| int Character::int_cur = 0 |
Definition at line 249 of file character.h.
Referenced by bionics_pl_skill(), check_needs_extremes(), crafting::complete_disassemble(), player::crafting_success_roll(), eff_fun_hallu(), iuse::einktabletpc(), computer_session::hack_attempt(), hack_level(), hackveh(), load(), make_fake_npc(), marloss_common(), mod_int_bonus(), iuse::multicooker(), iuse::mycus(), npc_trading::net_price_adjustment(), player::player(), iexamine::practice_survival_while_foraging(), game::process_artifact(), reset_stats(), mattack::riotbot(), activity_handlers::robot_control_finish(), iuse::robotcontrol(), conditional_t< T >::set_has_intelligence(), set_int_bonus(), standard_npc::standard_npc(), store(), try_reject_mutagen(), place_monster_iuse::use(), mutagen_iv_actor::use(), game::walk_move(), and memorial_logger::write().
| int Character::int_max = 0 |
Definition at line 244 of file character.h.
Referenced by apply_mods(), apply_skill_boost(), debug_menu::character_edit_menu(), get_int_base(), load(), mod_int_bonus(), mutation_effect(), mutation_loss_effect(), npc::npc(), player::player(), avatar::randomize(), npc::randomize(), reset_scenario(), reset_stats(), set_description(), set_int_bonus(), set_stats(), standard_npc::standard_npc(), store(), and memorial_logger::write().
| inventory Character::inv |
Definition at line 1519 of file character.h.
Referenced by inventory_selector::add_character_items(), advanced_inventory_pane::add_items_from_area(), allocated_invlets(), npc::alt_attack(), autoclave_internal(), autodoc_internal(), behavior::character_oracle_t::can_make_fire(), can_pick_volume(), player::can_start_craft(), iuse_transform::can_use(), behavior::character_oracle_t::can_wear_warmer_clothes(), debug_menu::character_edit_menu(), game_menus::inv::common(), game_menus::inv::compare(), complete_craft(), player::consume(), npc::consume_cbm_items(), npc::consume_food(), convert_to_items(), crafting_inventory(), avatar::create(), npc::decide_needs(), die(), dispose_item(), npc::dispose_item(), drop_invalid_inventory(), npc::drop_items(), findBestGasDiscount(), player::get_artifact_items(), player::get_eligible_containers_for_crafting(), item::get_encumber(), get_item_position(), item::get_remaining_capacity_for_liquid(), get_weight(), behavior::character_oracle_t::has_food(), npc::has_painkiller(), behavior::character_oracle_t::has_water(), npc::heal_self(), i_add(), i_add_or_drop(), i_at(), i_rem(), tutorial_game::init(), npc_trading::init_buying(), npc_trading::init_selling(), inv_dump(), inv_internal(), irradiate(), leak_level(), avatar::load(), load(), monster::load(), player::mend_item(), npc::mug_player(), game_menus::inv::multidrop(), iexamine::pay_gas(), pour_into(), player::process_items(), iuse::radiocar(), npc::randomize(), player::reassign_item(), item::reload(), pickup::reorder_for_dropping(), player::select_requirements(), set_item_inventory(), npc::shop_restock(), iuse::smoking(), player::sort_armor(), starting_inv(), avatar::store(), monster::store(), player::store(), game_menus::inv::swap_letters(), avatar_action::swim(), player::takeoff(), player::unwield(), npc::update_worst_item_value(), use_amount(), npc::use_painkiller(), volume_carried(), volume_carried_reduced_by(), wash_items(), player::wear(), wear_item(), weight_carried_reduced_by(), npc::wield(), avatar::wield(), npc::wield_better_weapon(), player::wield_contents(), and memorial_logger::write().
|
protected |
Definition at line 2068 of file character.h.
Referenced by add_known_trap(), knows_trap(), load(), and store().
| bool Character::last_climate_control_ret = false |
Definition at line 2215 of file character.h.
Referenced by in_climate_control(), and game::start_game().
| itype_id Character::last_item |
Definition at line 1520 of file character.h.
Referenced by i_add(), player::player(), player::process_turn(), npc::shop_restock(), player::use(), wear_item(), avatar::wield(), and player::wield_contents().
|
protected |
last time we checked for sleep
Definition at line 2073 of file character.h.
Referenced by player::load(), and player::store().
| weak_ptr_fast<Creature> Character::last_target |
Definition at line 1538 of file character.h.
Referenced by player::load(), and player::store().
| cata::optional<tripoint> Character::last_target_pos |
Definition at line 1539 of file character.h.
Referenced by player::load(), and player::store().
|
mutableprotected |
Subset of learned recipes.
Needs to be mutable for lazy initialization.
Definition at line 2101 of file character.h.
Referenced by avatar::create(), get_learned_recipes(), learn_recipe(), load(), and store().
| pimpl<known_magic> Character::magic |
Definition at line 1418 of file character.h.
Referenced by add_bionic(), spell::can_cast(), cast_spell(), item::color_in_inventory(), vehicle::deserialize(), spell::energy_cur_string(), known_magic::learn_spell(), learn_spells(), avatar::load(), load(), magic_train(), mana_stat(), on_mutation_gain(), on_mutation_loss(), print_mana(), npc::randomize(), spell_effect::recover_energy(), remove_bionic(), vehicle::serialize(), spell_panel(), activity_handlers::spellcasting_finish(), talk_function::start_training(), store(), activity_handlers::study_spell_do_turn(), activity_handlers::study_spell_finish(), update_body(), and learn_spell_actor::use().
| bool Character::male = true |
Definition at line 1505 of file character.h.
Referenced by debug_menu::character_edit_menu(), avatar::create(), draw_tip(), eff_fun_hallu(), extended_description(), npc::get_epilogue(), get_grammatical_genders(), npc::hp_description(), player::load(), npc::load_npc_template(), mattack::nurse_assist(), parse_tags(), pick_name(), player::player(), avatar::randomize(), npc::randomize(), npc::say(), set_description(), conditional_t< T >::set_is_gender(), set_profession(), set_scenario(), set_traits(), short_description_parts(), player::store(), and memorial_logger::write().
| pimpl<character_martial_arts> Character::martial_arts_data |
Definition at line 1525 of file character.h.
Referenced by activate_bionic(), mattack::bio_op_takedown(), block_hit(), player::can_grab_break(), can_miss_recovery(), item::color_in_inventory(), avatar::create(), deactivate_bionic(), draw_env_compact(), draw_weapon_classic(), draw_weapon_classic_alt(), draw_weapon_labels(), mattack::grab(), game::handle_action(), has_grab_break_tec(), ma_requirements::is_valid_character(), load(), iuse::ma_manual(), melee_attack(), melee_special_effects(), player::melee_value(), normalize(), player::on_dodge(), game::on_move_effects(), item::on_wield(), perform_technique(), pick_technique(), player::process_turn(), player::reach_attack(), avatar::read(), player::reset_stats(), read_inventory_preset::sort_compare(), store(), npc::styles_offered_to(), activity_handlers::train_finish(), used_weapon(), and avatar_action::wield().
|
private |
Definition at line 2172 of file character.h.
Referenced by find_remote_fuel(), get_max_power_level(), has_max_power(), is_max_power(), load(), mod_max_power_level(), set_max_power_level(), set_power_level(), and store().
|
private |
Definition at line 2194 of file character.h.
Referenced by add_miss_reason(), clear_miss_reasons(), and get_miss_reason().
|
protected |
Definition at line 2132 of file character.h.
Referenced by add_morale(), check_and_recover_morale(), clear_morale(), avatar::disp_morale(), player::environmental_revert_effect(), get_morale(), get_morale_level(), has_morale(), load(), monster::load(), on_effect_int_change(), on_item_takeoff(), on_item_wear(), on_mutation_gain(), on_mutation_loss(), on_stat_change(), player::on_worn_item_transform(), on_worn_item_washed(), rem_morale(), player::reset_stats(), store(), monster::store(), and update_morale().
| shared_ptr_fast<monster> Character::mounted_creature |
Definition at line 1556 of file character.h.
Referenced by cata_event_dispatch::avatar_moves(), best_nearby_lifting_assist(), player::can_lift(), map::can_move_furniture(), player::can_wield(), debug_menu::character_edit_menu(), check_mount_is_spooked(), check_mount_will_move(), npc::die(), dismount(), game::examine(), player::fire_gun(), forced_dismount(), ranged::gunmode_checks_weapon(), game::handle_action(), has_charges(), is_mounted(), load(), melee_attack(), mount_creature(), avatar_action::move(), npc::move_to(), npc::npc_dismount(), npc::on_load(), overmap_sight_range(), game::place_player(), game::place_player_overmap(), avatar_action::plthrow(), game::prompt_dangerous_tile(), recalc_sight_limits(), avatar::set_movement_mode(), smash(), store(), avatar_action::swim(), swim_speed(), player::throw_item(), throw_range(), use_charges(), game::validate_mounted_npcs(), game::vertical_move(), game::walk_move(), and weight_capacity().
| int Character::mounted_creature_id = 0 |
Definition at line 1558 of file character.h.
Referenced by load().
|
protected |
Definition at line 2128 of file character.h.
Referenced by player::basic_symbol_color(), burn_move_stamina(), avatar::cycle_move_mode(), get_movement_mode(), get_overlay_ids(), load(), movement_mode_is(), avatar::reset_move_mode(), run_cost(), avatar::set_movement_mode(), npc::set_movement_mode(), speed_rating(), stamina_move_cost_modifier(), store(), swim_speed(), avatar::toggle_crouch_mode(), and avatar::toggle_run_mode().
|
protected |
Definition at line 842 of file character.h.
Referenced by apply_wetness_morale(), and drench_mut_calc().
| std::map<std::string, int> Character::mutation_category_level |
Definition at line 1719 of file character.h.
Referenced by iuse::bell(), debug_menu::debug(), get_highest_category(), player::hardcoded_effects(), modify_morale(), mutation_chances(), set_highest_cat_level(), and test_crossing_threshold().
| pimpl<bionic_collection> Character::my_bionics |
Definition at line 1524 of file character.h.
Referenced by activate_bionic(), npc::activate_bionic_by_id(), add_bionic(), amount_of_storage_bionics(), iexamine::autodoc(), bionic_at_index(), player::bionic_by_invlet(), player::can_interface_armor(), npc::check_or_use_weapon_cbm(), clear_bionics(), crafting_inventory(), npc::deactivate_bionic_by_id(), character_display::disp_info(), draw_bionics_titlebar(), get_bionics(), get_overlay_ids(), has_active_bionic(), has_charges(), load(), num_bionics(), monster::nursebot_operate(), on_damage_of_type(), place_corpse(), player::power_bionics(), process_turn(), remove_bionic(), store(), uninstall_bionic(), npc::use_bionic_by_id(), and use_charges().
|
protected |
Definition at line 2126 of file character.h.
Referenced by npc::die(), npc::finish_read(), npc::form_opinion(), npc::get_faction(), npc::get_monster_faction(), npc::guaranteed_hostile(), npc::has_faction_relationship(), npc::is_ally(), npc::make_angry(), npc::mutiny(), npc::set_fac(), npc::set_known_to_u(), npc::shop_restock(), and npc::value().
|
protected |
Traits / mutations of the character.
Key is the mutation id (it's also a valid key into mutation_data), the value describes the status of the mutation. If there is not entry for a mutation, the character does not have it. If the map contains the entry, the character has the mutation.
Definition at line 2082 of file character.h.
Referenced by activate_mutation(), active_light(), clear_mutations(), avatar::create(), deactivate_mutation(), get_mutations(), get_overlay_ids(), has_active_mutation(), has_opposite_trait(), has_trait(), load(), mutation_effect(), mutation_spend_resources(), player::power_mutations_ui(), rebuild_mutation_cache(), set_mutation(), store(), suffer(), switch_mutations(), toggle_trait(), trait_by_invlet(), and unset_mutation().
|
protected |
Contains mutation ids of the base traits.
Definition at line 2086 of file character.h.
Referenced by clear_mutations(), get_base_traits(), has_base_trait(), load(), store(), and toggle_trait().
| std::string Character::name |
Definition at line 1504 of file character.h.
Referenced by assign_activity(), vehicle::automatic_fire_turret(), bionics_install_failure(), map::board_vehicle(), body_window(), butcher_corpse_activity(), butchery_drops_harvest(), talk_function::buy_100_logs(), talk_function::buy_10_logs(), talk_function::buy_haircut(), talk_function::buy_shave(), veh_interact::calc_overview(), can_wear(), enchantment::cast_enchantment_spell(), debug_menu::character_edit_menu(), activity_handlers::chop_logs_finish(), game::cleanup_at_end(), veh_interact::complete_vehicle(), target_ui::confirm_non_enemy_target(), npc::consume_food(), player::consume_item(), avatar::create(), mission_end::deposit_box(), item_location::impl::item_on_person::describe(), basecamp::deserialize(), faction::deserialize(), vehicle::deserialize(), npc::die(), player::disarm(), disp_name(), npc::do_reload(), overmap_ui::draw_ascii(), draw_tip(), npc::drop_items(), dialogue::dynamic_line(), talk_function::end_conversation(), enumerate_unmet_requirements(), npc::execute_action(), extended_description(), npc::faction_display(), fetch_activity(), talk_function::field_build_1(), talk_function::field_build_2(), talk_function::field_plant(), basecamp::finish_return(), player::fire_gun(), overmapbuffer::fix_npcs(), talk_function::flee(), talk_function::forage_return(), game::forced_door_closing(), npc::form_opinion(), iuse::geiger(), generic_multi_activity_locations(), get_name(), game::get_player_base_save_path(), vehicle::get_targeting_npc(), talk_function::give_aid(), talk_function::give_all_aid(), talk_function::give_equipment(), npc::go_to_omt_destination(), npc::handle_sound(), player::hardcoded_effects(), iexamine::harvest_plant(), healing_rate(), talk_function::hostile(), talk_function::insult_combat(), activity_handlers::jackhammer_finish(), talk_function::labor_return(), talk_function::leave(), load(), npc::load(), npc_template::load(), game::load(), submap::load(), npc::load_npc_template(), make_fake_npc(), melee_attack(), talk_function::morale_chat_activity(), npc::move(), move_item(), game::move_save_to_graveyard(), npc::move_to(), npc::mug_player(), mutation_attacks(), game::npc_menu(), npc_temp_orders_menu(), npc_throw(), player::on_hit(), npc::on_load(), dialogue::opt(), perform_technique(), trading_window::perform_trade(), petfood(), pick_name(), npc::pick_up_item(), activity_handlers::pickaxe_finish(), place_corpse(), mission_start::place_dog(), mission_start::place_npc_software(), npc::print_info(), print_info(), game::quickload(), avatar::randomize(), talk_function::remove_overseer(), reveal_target(), rod_fish(), game::save(), avatar::save_template(), npc::say(), npc::scan_new_items(), talk_function::scavenging_patrol_return(), talk_function::scavenging_raid_return(), player::select_ammo(), basecamp::serialize(), faction::serialize(), vehicle::serialize(), npc::set_attitude(), set_description(), talk_function::set_npc_pickup(), talk_effect_fun_t::set_u_buy_item(), talk_effect_fun_t::set_u_buy_monster(), talk_effect_fun_t::set_u_sell_item(), npc::setpos(), short_description_parts(), show_photo_selection(), player::sort_armor(), standard_npc::standard_npc(), talk_function::start_mugging(), game_menus::inv::steal(), avatar::steal(), talk_function::stop_following(), talk_function::stop_guard(), npc::store(), talk_function::stranger_neutral(), suffer_from_schizophrenia(), survive_random_encounter(), npc::talk_to_u(), tidy_activity(), npc::travel_overmap(), update_time_fixed(), trading_window::update_win(), npc::warn_about(), and memorial_logger::write().
| time_point Character::next_climate_control_check |
Definition at line 2214 of file character.h.
Referenced by in_climate_control(), and game::start_game().
|
private |
Definition at line 2191 of file character.h.
Referenced by clear_destination(), defer_move(), get_next_auto_move_direction(), and shift_destination().
| bool Character::nv_cached = false |
Definition at line 1509 of file character.h.
Referenced by action_taken(), has_nv(), player::player(), and reset_stats().
|
protected |
Definition at line 2106 of file character.h.
Referenced by get_vision_threshold(), and recalc_sight_limits().
| std::vector<tripoint_abs_omt> Character::omt_path |
Definition at line 970 of file character.h.
Referenced by cancel_auto_move(), autodrive_activity_actor::canceled(), overmap_ui::display(), vehicle::do_autodrive(), overmap_ui::draw_ascii(), npc::go_to_omt_destination(), talk_function::goto_location(), has_distant_destination(), load(), game::overmap_npc_move(), game::process_voluntary_act_interrupt(), npc::reach_omt_destination(), npc::set_omt_destination(), store(), and activity_handlers::travel_do_turn().
|
protected |
Amount of time the player has spent in each overmap tile.
Definition at line 2206 of file character.h.
Referenced by apply_persistent_morale(), load(), player::process_turn(), and store().
| int Character::oxygen = 0 |
Definition at line 1530 of file character.h.
Referenced by iuse::dive_tank(), load(), player::mod_stat(), player::player(), store(), suffer_from_asthma(), suffer_while_underwater(), avatar_action::swim(), and game::vertical_move().
|
mutableprotected |
Cache for pathfinding settings.
Most of it isn't changed too often, hence mutable.
Definition at line 2117 of file character.h.
Referenced by get_pathfinding_settings(), npc::get_pathfinding_settings(), avatar::grab(), and npc::npc().
|
protected |
Definition at line 2054 of file character.h.
Referenced by get_per(), get_per_bonus(), load(), mod_per_bonus(), reset_bonuses(), set_per_bonus(), and store().
| int Character::per_cur = 0 |
Definition at line 250 of file character.h.
Referenced by crit_chance(), trap::detect_trap(), activity_handlers::forage_finish(), vehicle::get_targeting_npc(), load(), make_fake_npc(), mod_per_bonus(), game::npc_menu(), pick_part_to_heal(), player::player(), game::process_artifact(), reset_stats(), conditional_t< T >::set_has_perception(), set_per_bonus(), iexamine::shrub_wildveggies(), standard_npc::standard_npc(), store(), musical_instrument_actor::use(), sew_advanced_actor::use(), and memorial_logger::write().
| int Character::per_max = 0 |
Definition at line 245 of file character.h.
Referenced by apply_mods(), apply_skill_boost(), debug_menu::character_edit_menu(), get_per_base(), load(), mod_per_bonus(), mutation_effect(), mutation_loss_effect(), npc::npc(), player::player(), avatar::randomize(), npc::randomize(), reset_scenario(), reset_stats(), set_description(), set_per_bonus(), set_stats(), standard_npc::standard_npc(), store(), and memorial_logger::write().
|
private |
Definition at line 2185 of file character.h.
Referenced by get_painkiller(), load(), mod_painkiller(), process_bionic(), set_painkiller(), and store().
|
protected |
Definition at line 2049 of file character.h.
Referenced by global_square_location(), npc::global_square_location(), has_destination_activity(), i_at(), load(), monster::load(), npc::load(), npc::npc(), npc::place_on_map(), pos(), posx(), posy(), posz(), player::reduce_charges(), setpos(), npc::setpos(), setx(), sety(), setz(), npc::spawn_at_precise(), standard_npc::standard_npc(), store(), monster::store(), player::uncanny_dodge(), repair_item_actor::use(), wear_item(), npc::wield(), and worn_position_to_index().
|
private |
Definition at line 2171 of file character.h.
Referenced by enough_power_for(), get_power_level(), has_power(), is_max_power(), load(), set_power_level(), and store().
| profession_id Character::prof |
Definition at line 563 of file character.h.
Referenced by newcharacter::add_traits(), can_pick_prof(), avatar::create(), draw_tip(), load(), avatar::randomize(), reset_scenario(), set_description(), set_profession(), set_scenario(), set_skills(), set_traits(), store(), and memorial_logger::write().
|
private |
| bool Character::reach_attacking = false |
Definition at line 602 of file character.h.
Referenced by melee_attack(), and player::reach_attack().
| int Character::reactor_plut = 0 |
Definition at line 1532 of file character.h.
Referenced by activate_bionic(), player::load(), player::store(), and suffer_from_radiation().
| double Character::recoil = MAX_RECOIL |
Definition at line 561 of file character.h.
Referenced by target_ui::action_aim_and_shoot(), npc::aim(), aim_per_move(), target_ui::apply_aim_turning_penalty(), npc::confident_shoot_range(), deal_damage(), do_aim(), npc::do_reload(), npc::execute_action(), player::fire_gun(), mattack::frag(), get_fastest_sight(), vehicle::get_targeting_npc(), game::list_monsters(), player::load(), make_fake_npc(), npc::method_of_attack(), npc::move_to(), player::on_dodge(), target_ui::panel_fire_mode_aim(), player::pause(), turret_data::post_fire(), turret_data::prepare_fire(), print_aim(), player::reach_attack(), target_ui::recalc_aim_turning_penalty(), recoil_total(), activity_handlers::reload_finish(), mattack::rifle(), gun_actor::shoot(), player::store(), mattack::tankgun(), player::throw_item(), game::walk_move(), and avatar::wield().
| int Character::scent = 0 |
Definition at line 1523 of file character.h.
Referenced by player::load(), and player::store().
|
protected |
Definition at line 2107 of file character.h.
Referenced by player::player(), recalc_sight_limits(), sight_range(), and unimpaired_range().
Size class of character.
Definition at line 2066 of file character.h.
Referenced by get_size(), and recalculate_size().
|
private |
Definition at line 2181 of file character.h.
Referenced by check_needs_extremes(), get_sleep_deprivation(), load(), mod_sleep_deprivation(), set_sleep_deprivation(), store(), suffer(), and suffer_without_sleep().
| int Character::slow_rad = 0 |
Definition at line 1533 of file character.h.
Referenced by activate_bionic(), player::load(), player::store(), and suffer_from_radiation().
|
private |
Definition at line 2178 of file character.h.
Referenced by get_stamina(), load(), mod_stamina(), set_stamina(), and store().
| player_activity Character::stashed_outbounds_activity |
Definition at line 1514 of file character.h.
Referenced by assign_stashed_activity(), cancel_stashed_activity(), check_outbounds_activity(), get_stashed_activity(), has_stashed_activity(), load(), set_stashed_activity(), and store().
| player_activity Character::stashed_outbounds_backlog |
Definition at line 1515 of file character.h.
Referenced by assign_stashed_activity(), cancel_stashed_activity(), check_outbounds_activity(), load(), set_stashed_activity(), and store().
|
private |
Definition at line 2184 of file character.h.
Referenced by get_stim(), load(), mod_stim(), set_stim(), and store().
| stomach_contents Character::stomach |
Definition at line 1527 of file character.h.
Referenced by npc::address_needs(), consume_effects(), npc::consume_food_from_camp(), eff_fun_hallu(), get_hunger_description(), initialize_stomach_contents(), load(), store(), suffer_from_radiation(), suffer_in_sunlight(), update_stomach(), avatar::vomit(), vomit(), player::vomit_mod(), and will_eat().
|
private |
Needs (hunger, starvation, thirst, fatigue, etc.)
Definition at line 2175 of file character.h.
Referenced by get_hunger_description(), get_stored_kcal(), load(), mod_stored_kcal(), set_stored_kcal(), and store().
|
protected |
Bonuses to stats, calculated each turn.
Definition at line 2052 of file character.h.
Referenced by get_str(), get_str_bonus(), load(), mod_str_bonus(), reset_bonuses(), set_str_bonus(), and store().
| int Character::str_cur = 0 |
Definition at line 247 of file character.h.
Referenced by iuse::anticonvulsant(), block_hit(), iuse::burrow(), map::can_move_furniture(), iuse::chop_moves(), iuse::crowbar(), dig_pit_moves_and_byproducts(), eff_fun_hallu(), get_shout_volume(), vehicle::get_targeting_npc(), handle_melee_wear(), item::is_two_handed(), load(), make_fake_npc(), melee_special_effects(), iuse::meth(), mine_activity(), mod_str_bonus(), om_harvest_furn(), iuse::pickaxe(), player::player(), game::process_artifact(), mattack::pull_metal_weapon(), activity_handlers::pulp_do_turn(), player::reach_attack(), reset_stats(), conditional_t< T >::set_has_strength(), set_str_bonus(), map::shake_vehicle(), sinkhole_safety_roll(), smash(), npc::smash_ability(), standard_npc::standard_npc(), store(), stumble(), avatar_action::swim(), swim_speed(), throw_range(), mutagen_iv_actor::use(), game::vertical_move(), and memorial_logger::write().
| int Character::str_max = 0 |
Definition at line 242 of file character.h.
Referenced by alcohol(), apply_mods(), apply_skill_boost(), calc_all_parts_hp(), debug_menu::character_edit_menu(), npc::form_opinion(), get_str_base(), player::hardcoded_effects(), player::knock_back_to(), load(), iuse::meth(), mod_str_bonus(), mutation_effect(), mutation_loss_effect(), npc::npc(), player::player(), avatar::randomize(), npc::randomize(), recalc_hp(), reset_scenario(), reset_stats(), set_description(), set_stats(), set_str_bonus(), trapfunc::shotgun(), standard_npc::standard_npc(), store(), and memorial_logger::write().
| int Character::tank_plut = 0 |
Definition at line 1531 of file character.h.
Referenced by activate_bionic(), feed_reactor_with(), player::load(), player::store(), and suffer_from_radiation().
| std::array<int, num_bp> Character::temp_conv |
Definition at line 2210 of file character.h.
Referenced by bodytemp_color(), load(), behavior::character_oracle_t::needs_warmth_badly(), player::normalize(), character_display::print_encumbrance(), should_combine_bps(), store(), temp_delta(), temp_delta_arrows(), temp_delta_string(), player::update_body_wetness(), and update_bodytemp().
| std::array<int, num_bp> Character::temp_cur |
Definition at line 2210 of file character.h.
Referenced by apply_wetness_morale(), eff_fun_hot(), player::hardcoded_effects(), load(), player::normalize(), store(), suffer_from_chemimbalance(), temp_delta(), temp_delta_arrows(), temp_delta_string(), temp_equalizer(), temp_stat(), and update_bodytemp().
|
private |
Definition at line 2177 of file character.h.
Referenced by get_thirst(), get_thirst_description(), load(), mod_thirst(), set_thirst(), and store().
|
protected |
Definition at line 2111 of file character.h.
Referenced by get_time_died(), and set_time_died().
|
private |
Definition at line 2192 of file character.h.
Referenced by get_type_of_scent(), load(), set_type_of_scent(), and store().
|
protected |
Definition at line 2104 of file character.h.
Referenced by clairvoyance(), get_vision_modes(), get_vision_threshold(), recalc_sight_limits(), and sees_with_infrared().
|
protected |
Current deficiency/excess quantity for each vitamin.
Definition at line 2130 of file character.h.
Referenced by load(), player::player(), store(), vitamin_get(), vitamin_mod(), and vitamin_set().
|
protected |
warnings from a faction about bad behavior
Definition at line 2075 of file character.h.
Referenced by player::load(), and player::store().
| item Character::weapon |
Definition at line 1521 of file character.h.
Referenced by activate_bionic(), inventory_selector::add_character_items(), npc::aim(), allocated_invlets(), npc::alt_attack(), apply_damage(), avatar_action::autoattack(), npc::average_damage_dealt(), best_shield(), mattack::bio_op_disarm(), mattack::bio_op_takedown(), block_hit(), can_fire_turret(), avatar_action::can_fire_weapon(), npc::can_reload_current(), can_wear(), player::can_wield(), cast_spell(), npc::character_danger(), debug_menu::character_edit_menu(), check_art_charge_req(), npc::check_or_use_weapon_cbm(), player::consume(), mattack::copbot(), crafting_inventory(), avatar::create(), deactivate_bionic(), deal_damage(), npc::decide_needs(), player::disarm(), npc::discharge_cbm_weapon(), dismount(), throw_activity_actor::do_turn(), iuse::ehandcuffs(), explosion_handler::emp_blast(), empty_buckets(), npc::execute_action(), extended_description(), npc::faction_display(), fire(), player::fire_gun(), avatar_action::fire_wielded_weapon(), forced_dismount(), npc::form_opinion(), mattack::frag(), player::get_artifact_items(), player::get_eligible_containers_for_crafting(), get_item_position(), get_overlay_ids(), item::get_remaining_capacity_for_liquid(), aim_activity_actor::get_weapon(), get_weight(), give_item_to(), mattack::grab(), player::gun_value(), game::handle_action(), handle_problematic_pickup(), player::hardcoded_effects(), hardcoded_mutation_attack(), has_artifact_with(), i_at(), i_rem(), npc_trading::init_buying(), npc_trading::init_selling(), player::intimidation(), inv_dump(), npc::invalidate_range_cache(), is_armed(), steal_inventory_preset::is_shown(), ma_requirements::is_valid_character(), is_wielding(), item_handling_cost(), mdeath::jabberwock(), game::list_monsters(), load(), game::load(), character_martial_arts::martialart_use_message(), melee_attack(), melee_special_effects(), player::melee_value(), avatar_action::mend(), npc::method_of_attack(), npc::move(), avatar_action::move(), npc::move_pause(), npc::move_to(), normalize(), npc::npc_dismount(), item_location::impl::item_on_person::obtain_cost(), player::on_dodge(), parse_tags(), pick_one_up(), avatar_action::plthrow(), power_rating(), npc::pretend_fire(), print_aim(), npc::print_info(), game::process_artifact(), item::process_extinguish(), player::process_items(), mattack::pull_metal_weapon(), activity_handlers::pulp_do_turn(), npc::randomize(), rate_critter(), reach_attack(), player::reach_attack(), npc::regen_ai_cache(), avatar_action::reload_weapon(), avatar_action::reload_wielded(), remove_weapon(), mattack::rifle(), mattack::riotbot(), examine_item_menu::run(), character_martial_arts::selected_style_name(), conditional_t< T >::set_can_stow_weapon(), gun_actor::shoot(), short_description_parts(), smash(), npc::smash_ability(), starting_inv(), npc::starting_weapon(), player::store(), npc::stow_item(), suffer_from_bad_bionics(), suffer_from_schizophrenia(), suffer_from_sunburn(), mattack::tankgun(), game::try_get_right_click_action(), salvage_actor::try_to_cut_up(), player::unwield(), update_bodytemp(), trading_window::update_win(), use_amount(), used_weapon(), npc::value(), player::weapname(), player::wear(), weight_carried_reduced_by(), weather_effect::wet_player(), npc::wield(), avatar::wield(), npc::wield_better_weapon(), player::wield_contents(), and memorial_logger::write().
| std::list<item> Character::worn |
Definition at line 1507 of file character.h.
Referenced by absorb_hit(), active_light(), advanced_inventory_pane::add_items_from_area(), npc::adjust_worn(), allocated_invlets(), amount_worn(), best_shield(), bodypart_exposure(), can_swap(), player::can_takeoff(), can_wear(), debug_menu::character_edit_menu(), check_and_recover_morale(), check_art_charge_req(), check_item_encumbrance_flag(), player::consume(), covered_with_flag(), crafting_inventory(), deal_damage(), dispose_item(), npc::dispose_item(), exclusive_flag_coverage(), extended_description(), fire(), get_armor(), get_armor_bash_base(), get_armor_bullet_base(), get_armor_cut_base(), get_armor_type(), player::get_artifact_items(), get_dependent_worn_items(), get_effective_efficiency(), player::get_eligible_containers_for_crafting(), item::get_encumber(), get_env_resist(), get_item_position(), get_overlay_ids(), get_weight(), player::hardcoded_effects(), has_artifact_with(), head_cloth_encumbrance(), i_at(), i_rem(), player::immune_to(), in_climate_control(), inv_dump(), is_wearing(), is_wearing_active_optcloak(), is_wearing_active_power_armor(), is_wearing_helmet(), is_wearing_on_bp(), is_wearing_power_armor(), is_wearing_shoes(), is_worn(), item_encumb(), item_worn_with_flag(), load(), natural_attack_restricted_on(), item::on_wear(), map::player_in_field(), position_to_wear_new_item(), npc::print_info(), player::process_items(), item::process_tool(), remove_worn_items_with(), short_description_parts(), player::sort_armor(), standard_npc::standard_npc(), starting_clothes(), player::store(), npc::stow_item(), swim_speed(), player::takeoff(), update_bodytemp(), set_transform_iuse::use(), use_amount(), volume_capacity_reduced_by(), npc::wear_if_wanted(), wear_item(), wearing_something_on(), weight_capacity(), weight_carried_reduced_by(), weather_effect::wet_player(), avatar::wield(), avatar_action::wield(), worn_with_flag(), and memorial_logger::write().